Ignore:
Timestamp:
2007/09/11 20:40:08 (17 years ago)
Author:
adachi
Message:

jQueryを1.1.4=>1.2へバージョンアップ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/html/js/jquery.js

    r15652 r15678  
    11(function(){ 
    22/* 
    3  * jQuery 1.1.4 - New Wave Javascript 
     3 * jQuery 1.2 - New Wave Javascript 
    44 * 
    55 * Copyright (c) 2007 John Resig (jquery.com) 
     
    77 * and GPL (GPL-LICENSE.txt) licenses. 
    88 * 
    9  * $Date: 2007-08-23 21:49:27 -0400 (Thu, 23 Aug 2007) $ 
    10  * $Rev: 2862 $ 
     9 * $Date: 2007-09-10 15:45:49 -0400 (Mon, 10 Sep 2007) $ 
     10 * $Rev: 3219 $ 
    1111 */ 
     12 
    1213// Map over jQuery in case of overwrite 
    1314if ( typeof jQuery != "undefined" ) 
     
    4243                // HANDLE: $(html) -> $(array) 
    4344                if ( m[1] ) 
    44                     a = jQuery.clean( [ m[1] ] ); 
     45                    a = jQuery.clean( [ m[1] ], c ); 
    4546 
    4647                // HANDLE: $("#id") 
     
    8182            [ a ] ); 
    8283    }, 
    83     jquery: "1.1.4", 
     84     
     85    jquery: "1.2", 
    8486 
    8587    size: function() { 
     
    98100            this[num]; 
    99101    }, 
     102     
    100103    pushStack: function( a ) { 
    101104        var ret = jQuery(a); 
     
    103106        return ret; 
    104107    }, 
     108     
    105109    setArray: function( a ) { 
    106110        this.length = 0; 
     
    108112        return this; 
    109113    }, 
     114 
    110115    each: function( fn, args ) { 
    111116        return jQuery.each( this, fn, args ); 
    112117    }, 
     118 
    113119    index: function( obj ) { 
    114120        var pos = -1; 
     
    161167    }, 
    162168 
    163     wrap: function() { 
    164         // The elements to wrap the target around 
    165         var a, args = arguments; 
    166  
    167         // Wrap each of the matched elements individually 
     169    wrapAll: function(html) { 
     170        if ( this[0] ) 
     171            // The elements to wrap the target around 
     172            jQuery(html, this[0].ownerDocument) 
     173                .clone() 
     174                .insertBefore(this[0]) 
     175                .map(function(){ 
     176                    var elem = this; 
     177                    while ( elem.firstChild ) 
     178                        elem = elem.firstChild; 
     179                    return elem; 
     180                }) 
     181                .append(this); 
     182 
     183        return this; 
     184    }, 
     185 
     186    wrapInner: function(html) { 
    168187        return this.each(function(){ 
    169             if ( !a ) 
    170                 a = jQuery.clean(args, this.ownerDocument); 
    171  
    172             // Clone the structure that we're using to wrap 
    173             var b = a[0].cloneNode(true); 
    174  
    175             // Insert it before the element to be wrapped 
    176             this.parentNode.insertBefore( b, this ); 
    177  
    178             // Find the deepest point in the wrap structure 
    179             while ( b.firstChild ) 
    180                 b = b.firstChild; 
    181  
    182             // Move the matched element to within the wrap structure 
    183             b.appendChild( this ); 
     188            jQuery(this).contents().wrapAll(html); 
    184189        }); 
    185190    }, 
     191 
     192    wrap: function(html) { 
     193        return this.each(function(){ 
     194            jQuery(this).wrapAll(html); 
     195        }); 
     196    }, 
     197 
    186198    append: function() { 
    187199        return this.domManip(arguments, true, 1, function(a){ 
     
    189201        }); 
    190202    }, 
     203 
    191204    prepend: function() { 
    192205        return this.domManip(arguments, true, -1, function(a){ 
     
    194207        }); 
    195208    }, 
     209     
    196210    before: function() { 
    197211        return this.domManip(arguments, false, 1, function(a){ 
     
    199213        }); 
    200214    }, 
     215 
    201216    after: function() { 
    202217        return this.domManip(arguments, false, -1, function(a){ 
     
    204219        }); 
    205220    }, 
     221 
    206222    end: function() { 
    207223        return this.prevObject || jQuery([]); 
    208224    }, 
     225 
    209226    find: function(t) { 
    210227        var data = jQuery.map(this, function(a){ return jQuery.find(t,a); }); 
     
    212229            jQuery.unique( data ) : data ); 
    213230    }, 
    214     clone: function(deep) { 
    215         deep = deep != undefined ? deep : true; 
    216         var $this = this.add(this.find("*")); 
    217         if (jQuery.browser.msie) { 
    218             // Need to remove events on the element and its descendants 
    219             $this.each(function() { 
    220                 this._$events = {}; 
    221                 for (var type in this.$events) 
    222                     this._$events[type] = jQuery.extend({},this.$events[type]); 
    223             }).unbind(); 
    224         } 
    225  
     231 
     232    clone: function(events) { 
    226233        // Do the clone 
    227         var r = this.pushStack( jQuery.map( this, function(a){ 
    228             return a.cloneNode( deep ); 
    229         }) ); 
    230  
    231         if (jQuery.browser.msie) { 
    232             $this.each(function() { 
    233                 // Add the events back to the original and its descendants 
    234                 var events = this._$events; 
    235                 for (var type in events) 
    236                     for (var handler in events[type]) 
    237                         jQuery.event.add(this, type, events[type][handler], events[type][handler].data); 
    238                 this._$events = null; 
     234        var ret = this.map(function(){ 
     235            return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true); 
     236        }); 
     237         
     238        if (events === true) { 
     239            var clone = ret.find("*").andSelf(); 
     240 
     241            this.find("*").andSelf().each(function(i) { 
     242                var events = jQuery.data(this, "events"); 
     243                for ( var type in events ) 
     244                    for ( var handler in events[type] ) 
     245                        jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data); 
    239246            }); 
    240247        } 
    241248 
    242         // copy form values over 
    243         if (deep) { 
    244             var inputs = r.add(r.find('*')).filter('select,input[@type=checkbox]'); 
    245             $this.filter('select,input[@type=checkbox]').each(function(i) { 
    246                 if (this.selectedIndex) 
    247                     inputs[i].selectedIndex = this.selectedIndex; 
    248                 if (this.checked) 
    249                     inputs[i].checked = true; 
    250             }); 
    251         } 
    252  
    253249        // Return the cloned set 
    254         return r; 
     250        return ret; 
    255251    }, 
    256252 
     
    287283        ); 
    288284    }, 
     285 
    289286    is: function(expr) { 
    290287        return expr ? jQuery.multiFilter(expr,this).length > 0 : false; 
    291288    }, 
    292289 
     290    hasClass: function(expr) { 
     291        return this.is("." + expr); 
     292    }, 
     293     
    293294    val: function( val ) { 
    294         return val == undefined ? 
    295             ( this.length ? this[0].value : null ) : 
    296             this.attr( "value", val ); 
    297     }, 
    298  
     295        if ( val == undefined ) { 
     296            if ( this.length ) { 
     297                var elem = this[0]; 
     298                 
     299                // We need to handle select boxes special 
     300                if ( jQuery.nodeName(elem, "select") ) { 
     301                    var index = elem.selectedIndex, 
     302                        a = [], 
     303                        options = elem.options, 
     304                        one = elem.type == "select-one"; 
     305                     
     306                    // Nothing was selected 
     307                    if ( index < 0 ) 
     308                        return null; 
     309 
     310                    // Loop through all the selected options 
     311                    for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { 
     312                        var option = options[i]; 
     313                        if ( option.selected ) { 
     314                            // Get the specifc value for the option 
     315                            var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value; 
     316                             
     317                            // We don't need an array for one selects 
     318                            if ( one ) 
     319                                return val; 
     320                             
     321                            // Multi-Selects return an array 
     322                            a.push(val); 
     323                        } 
     324                    } 
     325                     
     326                    return a; 
     327                     
     328                // Everything else, we just grab the value 
     329                } else 
     330                    return this[0].value.replace(/\r/g, ""); 
     331            } 
     332        } else 
     333            return this.each(function(){ 
     334                if ( val.constructor == Array && /radio|checkbox/.test(this.type) ) 
     335                    this.checked = (jQuery.inArray(this.value, val) >= 0 || 
     336                        jQuery.inArray(this.name, val) >= 0); 
     337                else if ( jQuery.nodeName(this, "select") ) { 
     338                    var tmp = val.constructor == Array ? val : [val]; 
     339 
     340                    jQuery("option", this).each(function(){ 
     341                        this.selected = (jQuery.inArray(this.value, tmp) >= 0 || 
     342                        jQuery.inArray(this.text, tmp) >= 0); 
     343                    }); 
     344 
     345                    if ( !tmp.length ) 
     346                        this.selectedIndex = -1; 
     347                } else 
     348                    this.value = val; 
     349            }); 
     350    }, 
     351     
    299352    html: function( val ) { 
    300353        return val == undefined ? 
     
    303356    }, 
    304357 
     358    replaceWith: function( val ) { 
     359        return this.after( val ).remove(); 
     360    }, 
     361 
    305362    slice: function() { 
    306363        return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); 
    307364    }, 
    308     domManip: function(args, table, dir, fn){ 
     365 
     366    map: function(fn) { 
     367        return this.pushStack(jQuery.map( this, function(elem,i){ 
     368            return fn.call( elem, i, elem ); 
     369        })); 
     370    }, 
     371 
     372    andSelf: function() { 
     373        return this.add( this.prevObject ); 
     374    }, 
     375     
     376    domManip: function(args, table, dir, fn) { 
    309377        var clone = this.length > 1, a;  
    310378 
     
    374442}; 
    375443 
     444var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {}; 
     445 
    376446jQuery.extend({ 
    377447    noConflict: function(deep) { 
     
    413483        return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); 
    414484    }, 
     485     
     486    cache: {}, 
     487     
     488    data: function( elem, name, data ) { 
     489        elem = elem == window ? win : elem; 
     490 
     491        var id = elem[ expando ]; 
     492 
     493        // Compute a unique ID for the element 
     494        if ( !id )  
     495            id = elem[ expando ] = ++uuid; 
     496 
     497        // Only generate the data cache if we're 
     498        // trying to access or manipulate it 
     499        if ( name && !jQuery.cache[ id ] ) 
     500            jQuery.cache[ id ] = {}; 
     501         
     502        // Prevent overriding the named cache with undefined values 
     503        if ( data != undefined ) 
     504            jQuery.cache[ id ][ name ] = data; 
     505         
     506        // Return the named cache data, or the ID for the element    
     507        return name ? jQuery.cache[ id ][ name ] : id; 
     508    }, 
     509     
     510    removeData: function( elem, name ) { 
     511        elem = elem == window ? win : elem; 
     512 
     513        var id = elem[ expando ]; 
     514 
     515        // If we want to remove a specific section of the element's data 
     516        if ( name ) { 
     517            if ( jQuery.cache[ id ] ) { 
     518                // Remove the section of cache data 
     519                delete jQuery.cache[ id ][ name ]; 
     520 
     521                // If we've removed all the data, remove the element's cache 
     522                name = ""; 
     523                for ( name in jQuery.cache[ id ] ) break; 
     524                if ( !name ) 
     525                    jQuery.removeData( elem ); 
     526            } 
     527 
     528        // Otherwise, we want to remove all of the element's data 
     529        } else { 
     530            // Clean up the element expando 
     531            try { 
     532                delete elem[ expando ]; 
     533            } catch(e){ 
     534                // IE has trouble directly removing the expando 
     535                // but it's ok with using removeAttribute 
     536                if ( elem.removeAttribute ) 
     537                    elem.removeAttribute( expando ); 
     538            } 
     539 
     540            // Completely remove the data cache 
     541            delete jQuery.cache[ id ]; 
     542        } 
     543    }, 
     544 
    415545    // args is for internal usage only 
    416546    each: function( obj, fn, args ) { 
     
    472602        } 
    473603    }, 
     604 
    474605    swap: function(e,o,f) { 
    475606        for ( var i in o ) { 
     
    589720            var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();}); 
    590721            ret = elem.currentStyle[prop] || elem.currentStyle[newProp]; 
     722 
     723            // From the awesome hack by Dean Edwards 
     724            // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 
     725 
     726            // If we're not dealing with a regular pixel number 
     727            // but a number that has a weird ending, we need to convert it to pixels 
     728            if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) { 
     729                var style = elem.style.left; 
     730                var runtimeStyle = elem.runtimeStyle.left; 
     731                elem.runtimeStyle.left = elem.currentStyle.left; 
     732                elem.style.left = ret || 0; 
     733                ret = elem.style.pixelLeft + "px"; 
     734                elem.style.left = style; 
     735                elem.runtimeStyle.left = runtimeStyle; 
     736            } 
    591737        } 
    592738 
     
    606752            // Convert html string into DOM nodes 
    607753            if ( typeof arg == "string" ) { 
     754                // Fix "XHTML"-style tags in all browsers 
     755                arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){ 
     756                    return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">"; 
     757                }); 
     758 
    608759                // Trim whitespace, otherwise indexOf won't work as expected 
    609760                var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = []; 
     
    701852        else if ( elem.tagName ) { 
    702853 
    703             if ( value != undefined ) elem.setAttribute( name, value ); 
     854            if ( value != undefined ) { 
     855                if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode ) 
     856                    throw "type property can't be changed"; 
     857                elem.setAttribute( name, value ); 
     858            } 
     859 
    704860            if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) )  
    705861                return elem.getAttribute( name, 2 ); 
     862 
    706863            return elem.getAttribute( name ); 
    707864 
     
    728885        } 
    729886    }, 
     887     
    730888    trim: function(t){ 
    731889        return (t||"").replace(/^\s+|\s+$/g, ""); 
     
    751909        return -1; 
    752910    }, 
     911 
    753912    merge: function(first, second) { 
    754913        // We have to loop this way because IE & Opera overwrite the length 
     
    767926        return first; 
    768927    }, 
     928 
    769929    unique: function(first) { 
    770         var r = [], num = jQuery.mergeNum++; 
     930        var r = [], done = {}; 
    771931 
    772932        try { 
    773             for ( var i = 0, fl = first.length; i < fl; i++ ) 
    774                 if ( num != first[i].mergeNum ) { 
    775                     first[i].mergeNum = num; 
     933            for ( var i = 0, fl = first.length; i < fl; i++ ) { 
     934                var id = jQuery.data(first[i]); 
     935                if ( !done[id] ) { 
     936                    done[id] = true; 
    776937                    r.push(first[i]); 
    777938                } 
     939            } 
    778940        } catch(e) { 
    779941            r = first; 
     
    783945    }, 
    784946 
    785     mergeNum: 0, 
    786947    grep: function(elems, fn, inv) { 
    787948        // If a string is passed in for the function, make a function 
     
    800961        return result; 
    801962    }, 
     963 
    802964    map: function(elems, fn) { 
    803965        // If a string is passed in for the function, make a function 
     
    822984    } 
    823985}); 
    824   
    825 /* 
    826  * Whether the W3C compliant box model is being used. 
    827  * 
    828  * @property 
    829  * @name $.boxModel 
    830  * @type Boolean 
    831  * @cat JavaScript 
    832  */ 
     986 
    833987var userAgent = navigator.userAgent.toLowerCase(); 
    834988 
     
    8691023jQuery.each({ 
    8701024    parent: "a.parentNode", 
    871     parents: "jQuery.parents(a)", 
     1025    parents: "jQuery.dir(a,'parentNode')", 
    8721026    next: "jQuery.nth(a,2,'nextSibling')", 
    8731027    prev: "jQuery.nth(a,2,'previousSibling')", 
     1028    nextAll: "jQuery.dir(a,'nextSibling')", 
     1029    prevAll: "jQuery.dir(a,'previousSibling')", 
    8741030    siblings: "jQuery.sibling(a.parentNode.firstChild,a)", 
    875     children: "jQuery.sibling(a.firstChild)" 
     1031    children: "jQuery.sibling(a.firstChild)", 
     1032    contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)" 
    8761033}, function(i,n){ 
    8771034    jQuery.fn[ i ] = function(a) { 
     
    8871044    prependTo: "prepend", 
    8881045    insertBefore: "before", 
    889     insertAfter: "after" 
     1046    insertAfter: "after", 
     1047    replaceAll: "replaceWith" 
    8901048}, function(i,n){ 
    8911049    jQuery.fn[ i ] = function(){ 
     
    9131071    }, 
    9141072    remove: function(a){ 
    915         if ( !a || jQuery.filter( a, [this] ).r.length ) 
     1073        if ( !a || jQuery.filter( a, [this] ).r.length ) { 
     1074            jQuery.removeData( this ); 
    9161075            this.parentNode.removeChild( this ); 
     1076        } 
    9171077    }, 
    9181078    empty: function() { 
     1079        // Clean up the cache 
     1080        jQuery("*", this).each(function(){ jQuery.removeData(this); }); 
     1081 
    9191082        while ( this.firstChild ) 
    9201083            this.removeChild( this.firstChild ); 
     
    9261089}); 
    9271090 
    928 // DEPRECATED 
    929 jQuery.each( [ "eq", "lt", "gt", "contains" ], function(i,n){ 
    930     jQuery.fn[ n ] = function(num,fn) { 
    931         return this.filter( ":" + n + "(" + num + ")", fn ); 
    932     }; 
    933 }); 
    934  
    935 jQuery.each( [ "height", "width" ], function(i,n){ 
     1091jQuery.each( [ "Height", "Width" ], function(i,name){ 
     1092    var n = name.toLowerCase(); 
     1093     
    9361094    jQuery.fn[ n ] = function(h) { 
    937         return h == undefined ? 
    938             ( this.length ? jQuery.css( this[0], n ) : null ) : 
    939             this.css( n, h.constructor == String ? h : h + "px" ); 
     1095        return this[0] == window ? 
     1096            jQuery.browser.safari && self["inner" + name] || 
     1097            jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) || 
     1098            document.body["client" + name] : 
     1099         
     1100            this[0] == document ? 
     1101                Math.max( document.body["scroll" + name], document.body["offset" + name] ) : 
     1102         
     1103                h == undefined ? 
     1104                    ( this.length ? jQuery.css( this[0], n ) : null ) : 
     1105                    this.css( n, h.constructor == String ? h : h + "px" ); 
    9401106    }; 
    9411107}); 
     
    9441110        "(?:[\\w*_-]|\\\\.)" : 
    9451111        "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)", 
    946     quickChild = new RegExp("^[/>]\\s*(" + chars + "+)"), 
     1112    quickChild = new RegExp("^>\\s*(" + chars + "+)"), 
    9471113    quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"), 
    9481114    quickClass = new RegExp("^([#.]?)(" + chars + "*)"); 
     
    9981164 
    9991165            // :has() 
    1000             has: "jQuery.find(m[3],a).length" 
    1001         }, 
    1002         // DEPRECATED 
    1003         "[": "jQuery.find(m[2],a).length" 
     1166            has: "jQuery.find(m[3],a).length", 
     1167 
     1168            // :header 
     1169            header: "/h\\d/i.test(a.nodeName)", 
     1170 
     1171            // :animated 
     1172            animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length" 
     1173        } 
    10041174    }, 
    10051175     
     
    10071177    parse: [ 
    10081178        // Match: [@value='test'], [@foo] 
    1009         /^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, 
    1010  
    1011         // DEPRECATED 
    1012         // Match: [div], [div p] 
    1013         /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/, 
     1179        /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, 
    10141180 
    10151181        // Match: :contains('foo') 
     
    10321198        return cur; 
    10331199    }, 
     1200 
    10341201    find: function( t, context ) { 
    10351202        // Quickly handle non-string expressions 
     
    10431210        // Set the correct context (if none is provided) 
    10441211        context = context || document; 
    1045  
    1046         // DEPRECATED 
    1047         // Handle the common XPath // expression 
    1048         if ( !t.indexOf("//") ) { 
    1049             //context = context.documentElement; 
    1050             t = t.substr(2,t.length); 
    1051  
    1052         // DEPRECATED 
    1053         // And the / root expression 
    1054         } else if ( !t.indexOf("/") && !context.ownerDocument ) { 
    1055             context = context.documentElement; 
    1056             t = t.substr(1,t.length); 
    1057             if ( t.indexOf("/") >= 1 ) 
    1058                 t = t.substr(t.indexOf("/"),t.length); 
    1059         } 
    10601212 
    10611213        // Initialize the search 
     
    10681220            last = t; 
    10691221 
    1070             // DEPRECATED 
    1071             t = jQuery.trim(t).replace( /^\/\//, "" ); 
     1222            t = jQuery.trim(t); 
    10721223 
    10731224            var foundToken = false; 
     
    10921243                foundToken = true; 
    10931244            } else { 
    1094                 // (.. and /) DEPRECATED 
    1095                 re = /^((\/?\.\.)|([>\/+~]))\s*(\w*)/i; 
     1245                re = /^([>+~])\s*(\w*)/i; 
    10961246 
    10971247                if ( (m = re.exec(t)) != null ) { 
    10981248                    r = []; 
    10991249 
    1100                     var nodeName = m[4], mergeNum = jQuery.mergeNum++; 
     1250                    var nodeName = m[2], merge = {}; 
    11011251                    m = m[1]; 
    11021252 
    1103                     for ( var j = 0, rl = ret.length; j < rl; j++ ) 
    1104                         if ( m.indexOf("..") < 0 ) { 
    1105                             var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild; 
    1106                             for ( ; n; n = n.nextSibling ) 
    1107                                 if ( n.nodeType == 1 ) { 
    1108                                     if ( m == "~" && n.mergeNum == mergeNum ) break; 
    1109                                      
    1110                                     if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) { 
    1111                                         if ( m == "~" ) n.mergeNum = mergeNum; 
    1112                                         r.push( n ); 
    1113                                     } 
    1114                                      
    1115                                     if ( m == "+" ) break; 
     1253                    for ( var j = 0, rl = ret.length; j < rl; j++ ) { 
     1254                        var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild; 
     1255                        for ( ; n; n = n.nextSibling ) 
     1256                            if ( n.nodeType == 1 ) { 
     1257                                var id = jQuery.data(n); 
     1258 
     1259                                if ( m == "~" && merge[id] ) break; 
     1260                                 
     1261                                if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) { 
     1262                                    if ( m == "~" ) merge[id] = true; 
     1263                                    r.push( n ); 
    11161264                                } 
    1117                         // DEPRECATED 
    1118                         } else 
    1119                             r.push( ret[j].parentNode ); 
     1265                                 
     1266                                if ( m == "+" ) break; 
     1267                            } 
     1268                    } 
    11201269 
    11211270                    ret = r; 
     
    11821331                        for ( var i = 0; ret[i]; i++ ) { 
    11831332                            // Grab the tag name being searched for 
    1184                             var tag = m[1] != "" || m[0] == "" ? "*" : m[2]; 
     1333                            var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2]; 
    11851334 
    11861335                            // Handle IE7 being really dumb about <object>s 
     
    12851434                r = jQuery.classFilter(r, m[2], not); 
    12861435 
    1287             else if ( m[1] == "@" ) { 
     1436            else if ( m[1] == "[" ) { 
    12881437                var tmp = [], type = m[3]; 
    12891438                 
     
    13071456            // We can get a speed boost by handling nth-child here 
    13081457            } else if ( m[1] == ":" && m[2] == "nth-child" ) { 
    1309                 var num = jQuery.mergeNum++, tmp = [], 
     1458                var merge = {}, tmp = [], 
    13101459                    test = /(\d*)n\+?(\d*)/.exec( 
    13111460                        m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" || 
     
    13141463 
    13151464                for ( var i = 0, rl = r.length; i < rl; i++ ) { 
    1316                     var node = r[i], parentNode = node.parentNode; 
    1317  
    1318                     if ( num != parentNode.mergeNum ) { 
     1465                    var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode); 
     1466 
     1467                    if ( !merge[id] ) { 
    13191468                        var c = 1; 
    13201469 
     
    13231472                                n.nodeIndex = c++; 
    13241473 
    1325                         parentNode.mergeNum = num; 
     1474                        merge[id] = true; 
    13261475                    } 
    13271476 
     
    13581507        return { r: r, t: t }; 
    13591508    }, 
    1360     parents: function( elem ){ 
     1509 
     1510    dir: function( elem, dir ){ 
    13611511        var matched = []; 
    1362         var cur = elem.parentNode; 
     1512        var cur = elem[dir]; 
    13631513        while ( cur && cur != document ) { 
    1364             matched.push( cur ); 
    1365             cur = cur.parentNode; 
     1514            if ( cur.nodeType == 1 ) 
     1515                matched.push( cur ); 
     1516            cur = cur[dir]; 
    13661517        } 
    13671518        return matched; 
    13681519    }, 
     1520     
    13691521    nth: function(cur,result,dir,elem){ 
    13701522        result = result || 1; 
     
    13771529        return cur; 
    13781530    }, 
     1531     
    13791532    sibling: function( n, elem ) { 
    13801533        var r = []; 
     
    14021555        if ( jQuery.browser.msie && element.setInterval != undefined ) 
    14031556            element = window; 
    1404          
     1557 
    14051558        // Make sure that the function being executed has a unique ID 
    14061559        if ( !handler.guid ) 
     
    14091562        // if data is passed, bind to handler  
    14101563        if( data != undefined ) {  
    1411             // Create temporary function pointer to original handler  
     1564                // Create temporary function pointer to original handler  
    14121565            var fn = handler;  
    14131566 
     
    14251578        } 
    14261579 
     1580        // Namespaced event handlers 
     1581        var parts = type.split("."); 
     1582        type = parts[0]; 
     1583        handler.type = parts[1]; 
     1584 
    14271585        // Init the element's event structure 
    1428         if (!element.$events) 
    1429             element.$events = {}; 
     1586        var events = jQuery.data(element, "events") || jQuery.data(element, "events", {}); 
    14301587         
    1431         if (!element.$handle) 
    1432             element.$handle = function() { 
    1433                 // returned undefined or false 
    1434                 var val; 
    1435  
    1436                 // Handle the second event of a trigger and when 
    1437                 // an event is called after a page has unloaded 
    1438                 if ( typeof jQuery == "undefined" || jQuery.event.triggered ) 
    1439                   return val; 
    1440                  
    1441                 val = jQuery.event.handle.apply(element, arguments); 
    1442                  
     1588        var handle = jQuery.data(element, "handle", function(){ 
     1589            // returned undefined or false 
     1590            var val; 
     1591 
     1592            // Handle the second event of a trigger and when 
     1593            // an event is called after a page has unloaded 
     1594            if ( typeof jQuery == "undefined" || jQuery.event.triggered ) 
    14431595                return val; 
    1444             }; 
     1596             
     1597            val = jQuery.event.handle.apply(element, arguments); 
     1598             
     1599            return val; 
     1600        }); 
    14451601 
    14461602        // Get the current list of functions bound to this event 
    1447         var handlers = element.$events[type]; 
     1603        var handlers = events[type]; 
    14481604 
    14491605        // Init the event handler queue 
    14501606        if (!handlers) { 
    1451             handlers = element.$events[type] = {};   
     1607            handlers = events[type] = {};    
    14521608             
    14531609            // And bind the global event handler to the element 
    14541610            if (element.addEventListener) 
    1455                 element.addEventListener(type, element.$handle, false); 
     1611                element.addEventListener(type, handle, false); 
    14561612            else 
    1457                 element.attachEvent("on" + type, element.$handle); 
     1613                element.attachEvent("on" + type, handle); 
    14581614        } 
    14591615 
     
    14701626    // Detach an event or set of events from an element 
    14711627    remove: function(element, type, handler) { 
    1472         var events = element.$events, ret, index; 
     1628        var events = jQuery.data(element, "events"), ret, index; 
     1629 
     1630        // Namespaced event handlers 
     1631        if ( typeof type == "string" ) { 
     1632            var parts = type.split("."); 
     1633            type = parts[0]; 
     1634        } 
    14731635 
    14741636        if ( events ) { 
     
    14901652                // remove all handlers for the given type 
    14911653                else 
    1492                     for ( handler in element.$events[type] ) 
    1493                         delete events[type][handler]; 
     1654                    for ( handler in events[type] ) 
     1655                        // Handle the removal of namespaced events 
     1656                        if ( !parts[1] || events[type][handler].type == parts[1] ) 
     1657                            delete events[type][handler]; 
    14941658 
    14951659                // remove generic event handler if no more handlers exist 
     
    14971661                if ( !ret ) { 
    14981662                    if (element.removeEventListener) 
    1499                         element.removeEventListener(type, element.$handle, false); 
     1663                        element.removeEventListener(type, jQuery.data(element, "handle"), false); 
    15001664                    else 
    1501                         element.detachEvent("on" + type, element.$handle); 
     1665                        element.detachEvent("on" + type, jQuery.data(element, "handle")); 
    15021666                    ret = null; 
    15031667                    delete events[type]; 
     
    15071671            // Remove the expando if it's no longer used 
    15081672            for ( ret in events ) break; 
    1509             if ( !ret ) 
    1510                 element.$handle = element.$events = null; 
    1511         } 
    1512     }, 
    1513  
    1514     trigger: function(type, data, element) { 
     1673            if ( !ret ) { 
     1674                jQuery.removeData( element, "events" ); 
     1675                jQuery.removeData( element, "handle" ); 
     1676            } 
     1677        } 
     1678    }, 
     1679 
     1680    trigger: function(type, data, element, donative, extra) { 
    15151681        // Clone the incoming data, if any 
    15161682        data = jQuery.makeArray(data || []); 
     
    15241690        // Handle triggering a single element 
    15251691        } else { 
    1526             var val, ret, fn = jQuery.isFunction( element[ type ] || null ); 
     1692            var val, ret, fn = jQuery.isFunction( element[ type ] || null ), 
     1693                // Check to see if we need to provide a fake event, or not 
     1694                evt = !data[0] || !data[0].preventDefault; 
    15271695             
    15281696            // Pass along a fake event 
    1529             data.unshift( this.fix({ type: type, target: element }) ); 
     1697            if ( evt ) 
     1698                data.unshift( this.fix({ type: type, target: element }) ); 
    15301699 
    15311700            // Trigger the event 
    1532             if ( jQuery.isFunction( element.$handle ) ) 
    1533                 val = element.$handle.apply( element, data ); 
     1701            if ( jQuery.isFunction( jQuery.data(element, "handle") ) ) 
     1702                val = jQuery.data(element, "handle").apply( element, data ); 
     1703 
     1704            // Handle triggering native .onfoo handlers 
    15341705            if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false ) 
    15351706                val = false; 
    15361707 
    1537             if ( fn && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) { 
     1708            // Extra functions don't get the custom event object 
     1709            if ( evt ) 
     1710                data.shift(); 
     1711 
     1712            // Handle triggering of extra function 
     1713            if ( extra && extra.apply( element, data ) === false ) 
     1714                val = false; 
     1715 
     1716            // Trigger the native events (except for clicks on links) 
     1717            if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) { 
    15381718                this.triggered = true; 
    15391719                element[ type ](); 
     
    15421722            this.triggered = false; 
    15431723        } 
     1724 
     1725        return val; 
    15441726    }, 
    15451727 
     
    15511733        event = jQuery.event.fix( event || window.event || {} );  
    15521734 
    1553         var c = this.$events && this.$events[event.type], args = Array.prototype.slice.call( arguments, 1 ); 
     1735        // Namespaced event handlers 
     1736        var parts = event.type.split("."); 
     1737        event.type = parts[0]; 
     1738 
     1739        var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 ); 
    15541740        args.unshift( event ); 
    15551741 
     
    15601746            args[0].data = c[j].data; 
    15611747 
    1562             if ( c[j].apply( this, args ) === false ) { 
    1563                 event.preventDefault(); 
    1564                 event.stopPropagation(); 
    1565                 val = false; 
     1748            // Filter the functions by class 
     1749            if ( !parts[1] || c[j].type == parts[1] ) { 
     1750                var tmp = c[j].apply( this, args ); 
     1751 
     1752                if ( val !== false ) 
     1753                    val = tmp; 
     1754 
     1755                if ( tmp === false ) { 
     1756                    event.preventDefault(); 
     1757                    event.stopPropagation(); 
     1758                } 
    15661759            } 
    15671760        } 
     
    16401833        }); 
    16411834    }, 
     1835     
    16421836    one: function( type, data, fn ) { 
    16431837        return this.each(function(){ 
     
    16481842        }); 
    16491843    }, 
     1844 
    16501845    unbind: function( type, fn ) { 
    16511846        return this.each(function(){ 
     
    16531848        }); 
    16541849    }, 
    1655     trigger: function( type, data ) { 
     1850 
     1851    trigger: function( type, data, fn ) { 
    16561852        return this.each(function(){ 
    1657             jQuery.event.trigger( type, data, this ); 
     1853            jQuery.event.trigger( type, data, this, true, fn ); 
    16581854        }); 
    16591855    }, 
     1856 
     1857    triggerHandler: function( type, data, fn ) { 
     1858        if ( this[0] ) 
     1859            return jQuery.event.trigger( type, data, this[0], false, fn ); 
     1860    }, 
     1861 
    16601862    toggle: function() { 
    16611863        // Save reference to arguments for access in closure 
     
    16731875        }); 
    16741876    }, 
     1877 
    16751878    hover: function(f,g) { 
    16761879         
     
    16931896        return this.mouseover(handleHover).mouseout(handleHover); 
    16941897    }, 
     1898     
    16951899    ready: function(f) { 
    16961900        // Attach the listeners 
     
    17461950}); 
    17471951 
    1748     jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + 
    1749         "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +  
    1750         "submit,keydown,keypress,keyup,error").split(","), function(i,o){ 
    1751          
    1752         // Handle event binding 
    1753         jQuery.fn[o] = function(f){ 
    1754             return f ? this.bind(o, f) : this.trigger(o); 
    1755         }; 
    1756              
    1757     }); 
     1952jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + 
     1953    "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +  
     1954    "submit,keydown,keypress,keyup,error").split(","), function(i,o){ 
     1955     
     1956    // Handle event binding 
     1957    jQuery.fn[o] = function(f){ 
     1958        return f ? this.bind(o, f) : this.trigger(o); 
     1959    }; 
     1960}); 
    17581961 
    17591962var readyBound = false; 
     
    17821985        if ( script )  
    17831986            script.onreadystatechange = function() { 
    1784                 if ( document.readyState != "complete" ) return; 
     1987                if ( this.readyState != "complete" ) return; 
    17851988                jQuery.ready(); 
    17861989            }; 
     
    18102013} 
    18112014jQuery.fn.extend({ 
    1812     // DEPRECATED 
    1813     loadIfModified: function( url, params, callback ) { 
    1814         this.load( url, params, callback, 1 ); 
    1815     }, 
    1816     load: function( url, params, callback, ifModified ) { 
     2015    load: function( url, params, callback ) { 
    18172016        if ( jQuery.isFunction( url ) ) 
    18182017            return this.bind("load", url); 
     2018 
     2019        var off = url.indexOf(" "); 
     2020        if ( off >= 0 ) { 
     2021            var selector = url.slice(off, url.length); 
     2022            url = url.slice(0, off); 
     2023        } 
    18192024 
    18202025        callback = callback || function(){}; 
     
    18442049            type: type, 
    18452050            data: params, 
    1846             ifModified: ifModified, 
    18472051            complete: function(res, status){ 
    18482052                // If successful, inject the HTML into all the matched elements 
    1849                 if ( status == "success" || !ifModified && status == "notmodified" ) 
    1850                     self.html(res.responseText); 
     2053                if ( status == "success" || status == "notmodified" ) 
     2054                    // See if a selector was specified 
     2055                    self.html( selector ? 
     2056                        // Create a dummy div to hold the results 
     2057                        jQuery("<div/>") 
     2058                            // inject the contents of the document in, removing the scripts 
     2059                            // to avoid any 'Permission Denied' errors in IE 
     2060                            .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) 
     2061 
     2062                            // Locate the specified elements 
     2063                            .find(selector) : 
     2064 
     2065                        // If not, just inject the full result 
     2066                        res.responseText ); 
    18512067 
    18522068                // Add delay to account for Safari's delay in globalEval 
     
    18582074        return this; 
    18592075    }, 
     2076 
    18602077    serialize: function() { 
    1861         return jQuery.param( this ); 
    1862     }, 
    1863  
    1864     // DEPRECATED 
    1865     // This method no longer does anything - all script evaluation is 
    1866     // taken care of within the HTML injection methods. 
    1867     evalScripts: function(){} 
    1868  
     2078        return jQuery.param(this.serializeArray()); 
     2079    }, 
     2080    serializeArray: function() { 
     2081        return this.map(function(){ 
     2082            return jQuery.nodeName(this, "form") ? 
     2083                jQuery.makeArray(this.elements) : this; 
     2084        }) 
     2085        .filter(function(){ 
     2086            return this.name && !this.disabled &&  
     2087                (this.checked || /select|textarea/i.test(this.nodeName) ||  
     2088                    /text|hidden|password/i.test(this.type)); 
     2089        }) 
     2090        .map(function(i, elem){ 
     2091            var val = jQuery(this).val(); 
     2092            return val == null ? null : 
     2093                val.constructor == Array ? 
     2094                    jQuery.map( val, function(i, val){ 
     2095                        return {name: elem.name, value: val}; 
     2096                    }) : 
     2097                    {name: elem.name, value: val}; 
     2098        }).get(); 
     2099    } 
    18692100}); 
    18702101 
    18712102// Attach a bunch of functions for handling common AJAX events 
    1872  
    18732103jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ 
    18742104    jQuery.fn[o] = function(f){ 
     
    18772107}); 
    18782108 
     2109var jsc = (new Date).getTime(); 
     2110 
    18792111jQuery.extend({ 
    1880     get: function( url, data, callback, type, ifModified ) { 
     2112    get: function( url, data, callback, type ) { 
    18812113        // shift arguments if data argument was ommited 
    18822114        if ( jQuery.isFunction( data ) ) { 
     
    18902122            data: data, 
    18912123            success: callback, 
    1892             dataType: type, 
    1893             ifModified: ifModified 
     2124            dataType: type 
    18942125        }); 
    18952126    }, 
    1896     // DEPRECATED 
    1897     getIfModified: function( url, data, callback, type ) { 
    1898         return jQuery.get(url, data, callback, type, 1); 
    1899     }, 
     2127 
    19002128    getScript: function( url, callback ) { 
    19012129        return jQuery.get(url, null, callback, "script"); 
    19022130    }, 
     2131 
    19032132    getJSON: function( url, data, callback ) { 
    19042133        return jQuery.get(url, data, callback, "json"); 
    19052134    }, 
     2135 
    19062136    post: function( url, data, callback, type ) { 
    19072137        if ( jQuery.isFunction( data ) ) { 
     
    19182148        }); 
    19192149    }, 
    1920     // DEPRECATED 
    1921     ajaxTimeout: function( timeout ) { 
    1922         jQuery.ajaxSettings.timeout = timeout; 
    1923     }, 
     2150 
    19242151    ajaxSetup: function( settings ) { 
    19252152        jQuery.extend( jQuery.ajaxSettings, settings ); 
     
    19382165    // Last-Modified header cache for next request 
    19392166    lastModified: {}, 
     2167 
    19402168    ajax: function( s ) { 
     2169        var jsonp, jsre = /=(\?|%3F)/g, status, data; 
     2170 
    19412171        // Extend the settings, but re-extend 's' so that it can be 
    19422172        // checked again later (in the test suite, specifically) 
    19432173        s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); 
    19442174 
    1945         // if data available 
    1946         if ( s.data ) { 
    1947             // convert data if not already a string 
    1948             if ( s.processData && typeof s.data != "string" ) 
    1949                 s.data = jQuery.param(s.data); 
    1950  
    1951             // append data to url for get requests 
    1952             if ( s.type.toLowerCase() == "get" ) { 
    1953                 // "?" + data or "&" + data (in case there are already params) 
    1954                 s.url += (s.url.indexOf("?") > -1 ? "&" : "?") + s.data; 
    1955  
    1956                 // IE likes to send both get and post data, prevent this 
    1957                 s.data = null; 
    1958             } 
     2175        // convert data if not already a string 
     2176        if ( s.data && s.processData && typeof s.data != "string" ) 
     2177            s.data = jQuery.param(s.data); 
     2178 
     2179        // Break the data into one single string 
     2180        var q = s.url.indexOf("?"); 
     2181        if ( q > -1 ) { 
     2182            s.data = (s.data ? s.data + "&" : "") + s.url.slice(q + 1); 
     2183            s.url = s.url.slice(0, q); 
     2184        } 
     2185 
     2186        // Handle JSONP Parameter Callbacks 
     2187        if ( s.dataType == "jsonp" ) { 
     2188            if ( !s.data || !s.data.match(jsre) ) 
     2189                s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; 
     2190            s.dataType = "json"; 
     2191        } 
     2192 
     2193        // Build temporary JSONP function 
     2194        if ( s.dataType == "json" && s.data && s.data.match(jsre) ) { 
     2195            jsonp = "jsonp" + jsc++; 
     2196            s.data = s.data.replace(jsre, "=" + jsonp); 
     2197 
     2198            // We need to make sure 
     2199            // that a JSONP style response is executed properly 
     2200            s.dataType = "script"; 
     2201 
     2202            // Handle JSONP-style loading 
     2203            window[ jsonp ] = function(tmp){ 
     2204                data = tmp; 
     2205                success(); 
     2206                // Garbage collect 
     2207                window[ jsonp ] = undefined; 
     2208                try{ delete window[ jsonp ]; } catch(e){} 
     2209            }; 
     2210        } 
     2211 
     2212        if ( s.dataType == "script" && s.cache == null ) 
     2213            s.cache = false; 
     2214 
     2215        if ( s.cache === false && s.type.toLowerCase() == "get" ) 
     2216            s.data = (s.data ? s.data + "&" : "") + "_=" + (new Date()).getTime(); 
     2217 
     2218        // If data is available, append data to url for get requests 
     2219        if ( s.data && s.type.toLowerCase() == "get" ) { 
     2220            s.url += "?" + s.data; 
     2221 
     2222            // IE likes to send both get and post data, prevent this 
     2223            s.data = null; 
    19592224        } 
    19602225 
     
    19622227        if ( s.global && ! jQuery.active++ ) 
    19632228            jQuery.event.trigger( "ajaxStart" ); 
     2229 
     2230        // If we're requesting a remote document 
     2231        // and trying to load JSON or Script 
     2232        if ( !s.url.indexOf("http") && s.dataType == "script" ) { 
     2233            var head = document.getElementsByTagName("head")[0]; 
     2234            var script = document.createElement("script"); 
     2235            script.src = s.url; 
     2236 
     2237            // Handle Script loading 
     2238            if ( !jsonp && (s.success || s.complete) ) { 
     2239                var done = false; 
     2240 
     2241                // Attach handlers for all browsers 
     2242                script.onload = script.onreadystatechange = function(){ 
     2243                    if ( !done && (!this.readyState ||  
     2244                            this.readyState == "loaded" || this.readyState == "complete") ) { 
     2245                        done = true; 
     2246                        success(); 
     2247                        complete(); 
     2248                        head.removeChild( script ); 
     2249                    } 
     2250                }; 
     2251            } 
     2252 
     2253            head.appendChild(script); 
     2254 
     2255            // We handle everything using the script element injection 
     2256            return; 
     2257        } 
    19642258 
    19652259        var requestDone = false; 
     
    19852279 
    19862280        // Allow custom headers/mimetypes 
    1987         if( s.beforeSend ) 
     2281        if ( s.beforeSend ) 
    19882282            s.beforeSend(xml); 
    19892283             
     
    20032297                } 
    20042298                 
    2005                 var status = isTimeout == "timeout" && "timeout" || 
     2299                status = isTimeout == "timeout" && "timeout" || 
    20062300                    !jQuery.httpSuccess( xml ) && "error" || 
    20072301                    s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" || 
     
    20122306                    try { 
    20132307                        // process the data (runs the xml through httpData regardless of callback) 
    2014                         var data = jQuery.httpData( xml, s.dataType ); 
     2308                        data = jQuery.httpData( xml, s.dataType ); 
    20152309                    } catch(e) { 
    20162310                        status = "parsererror"; 
     
    20282322                    if ( s.ifModified && modRes ) 
    20292323                        jQuery.lastModified[s.url] = modRes; 
    2030      
    2031                     // If a local callback was specified, fire it and pass it the data 
    2032                     if ( s.success ) 
    2033                         s.success( data, status ); 
    2034      
    2035                     // Fire the global callback 
    2036                     if ( s.global ) 
    2037                         jQuery.event.trigger( "ajaxSuccess", [xml, s] ); 
     2324 
     2325                    // JSONP handles its own success callback 
     2326                    if ( !jsonp ) 
     2327                        success();   
    20382328                } else 
    20392329                    jQuery.handleError(s, xml, status); 
    20402330 
    2041                 // The request was completed 
    2042                 if( s.global ) 
    2043                     jQuery.event.trigger( "ajaxComplete", [xml, s] ); 
    2044  
    2045                 // Handle the global AJAX counter 
    2046                 if ( s.global && ! --jQuery.active ) 
    2047                     jQuery.event.trigger( "ajaxStop" ); 
    2048  
    2049                 // Process result 
    2050                 if ( s.complete ) 
    2051                     s.complete(xml, status); 
     2331                // Fire the complete handlers 
     2332                complete(); 
    20522333 
    20532334                // Stop memory leaks 
    2054                 if(s.async) 
     2335                if ( s.async ) 
    20552336                    xml = null; 
    20562337            } 
     
    20882369        // return XMLHttpRequest to allow aborting the request etc. 
    20892370        return xml; 
     2371 
     2372        function success(){ 
     2373            // If a local callback was specified, fire it and pass it the data 
     2374            if ( s.success ) 
     2375                s.success( data, status ); 
     2376 
     2377            // Fire the global callback 
     2378            if ( s.global ) 
     2379                jQuery.event.trigger( "ajaxSuccess", [xml, s] ); 
     2380        } 
     2381 
     2382        function complete(){ 
     2383            // Process result 
     2384            if ( s.complete ) 
     2385                s.complete(xml, status); 
     2386 
     2387            // The request was completed 
     2388            if ( s.global ) 
     2389                jQuery.event.trigger( "ajaxComplete", [xml, s] ); 
     2390 
     2391            // Handle the global AJAX counter 
     2392            if ( s.global && ! --jQuery.active ) 
     2393                jQuery.event.trigger( "ajaxStop" ); 
     2394        } 
    20902395    }, 
    20912396 
     
    21242429    }, 
    21252430 
    2126     /* Get the data out of an XMLHttpRequest. 
    2127      * Return parsed XML if content-type header is "xml" and type is "xml" or omitted, 
    2128      * otherwise return plain text. 
    2129      * (String) data - The type of data that you're expecting back, 
    2130      * (e.g. "xml", "html", "script") 
    2131      */ 
    21322431    httpData: function( r, type ) { 
    21332432        var ct = r.getResponseHeader("content-type"); 
    21342433        var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0; 
    2135         data = xml ? r.responseXML : r.responseText; 
     2434        var data = xml ? r.responseXML : r.responseText; 
    21362435 
    21372436        if ( xml && data.documentElement.tagName == "parsererror" ) 
     
    21752474 
    21762475        // Return the resulting serialization 
    2177         return s.join("&"); 
     2476        return s.join("&").replace(/%20/g, "+"); 
    21782477    } 
    21792478 
    21802479}); 
    21812480jQuery.fn.extend({ 
    2182  
    21832481    show: function(speed,callback){ 
    21842482        return speed ? 
     
    21932491            }).end(); 
    21942492    }, 
    2195  
     2493     
    21962494    hide: function(speed,callback){ 
    21972495        return speed ? 
     
    22102508    // Save the old toggle function 
    22112509    _toggle: jQuery.fn.toggle, 
     2510     
    22122511    toggle: function( fn, fn2 ){ 
    22132512        return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? 
     
    22212520                }); 
    22222521    }, 
     2522     
    22232523    slideDown: function(speed,callback){ 
    22242524        return this.animate({height: "show"}, speed, callback); 
    22252525    }, 
     2526     
    22262527    slideUp: function(speed,callback){ 
    22272528        return this.animate({height: "hide"}, speed, callback); 
    22282529    }, 
     2530 
    22292531    slideToggle: function(speed, callback){ 
    22302532        return this.animate({height: "toggle"}, speed, callback); 
    22312533    }, 
     2534     
    22322535    fadeIn: function(speed, callback){ 
    22332536        return this.animate({opacity: "show"}, speed, callback); 
    22342537    }, 
     2538     
    22352539    fadeOut: function(speed, callback){ 
    22362540        return this.animate({opacity: "hide"}, speed, callback); 
    22372541    }, 
     2542     
    22382543    fadeTo: function(speed,to,callback){ 
    22392544        return this.animate({opacity: to}, speed, callback); 
    22402545    }, 
     2546     
    22412547    animate: function( prop, speed, easing, callback ) { 
    2242         return this.queue(function(){ 
    2243             var hidden = jQuery(this).is(":hidden"), 
    2244                 opt = jQuery.speed(speed, easing, callback), 
    2245                 self = this; 
     2548        var opt = jQuery.speed(speed, easing, callback); 
     2549 
     2550        return this[ opt.queue === false ? "each" : "queue" ](function(){ 
     2551            opt = jQuery.extend({}, opt); 
     2552            var hidden = jQuery(this).is(":hidden"), self = this; 
    22462553             
    22472554            for ( var p in prop ) { 
     
    22612568                this.style.overflow = "hidden"; 
    22622569 
    2263             this.curAnim = jQuery.extend({}, prop); 
     2570            opt.curAnim = jQuery.extend({}, prop); 
    22642571             
    22652572            jQuery.each( prop, function(name, val){ 
    22662573                var e = new jQuery.fx( self, opt, name ); 
    2267                 if ( val.constructor == Number ) 
    2268                     e.custom( e.cur() || 0, val ); 
    2269                 else 
     2574 
     2575                if ( /toggle|show|hide/.test(val) ) 
    22702576                    e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); 
     2577                else { 
     2578                    var parts = val.toString().match(/^([+-]?)([\d.]+)(.*)$/), 
     2579                        start = e.cur(true) || 0; 
     2580 
     2581                    if ( parts ) { 
     2582                        end = parseFloat(parts[2]), 
     2583                        unit = parts[3] || "px"; 
     2584 
     2585                        // We need to compute starting value 
     2586                        if ( unit != "px" ) { 
     2587                            self.style[ name ] = end + unit; 
     2588                            start = (end / e.cur(true)) * start; 
     2589                            self.style[ name ] = start + unit; 
     2590                        } 
     2591 
     2592                        // If a +/- token was provided, we're doing a relative animation 
     2593                        if ( parts[1] ) 
     2594                            end = ((parts[1] == "-" ? -1 : 1) * end) + start; 
     2595 
     2596                        e.custom( start, end, unit ); 
     2597                    } else 
     2598                        e.custom( start, val, "" ); 
     2599                } 
    22712600            }); 
    22722601 
     
    22752604        }); 
    22762605    }, 
    2277     queue: function(type,fn){ 
     2606     
     2607    queue: function(type, fn){ 
    22782608        if ( !fn ) { 
    22792609            fn = type; 
    22802610            type = "fx"; 
    22812611        } 
    2282      
     2612 
     2613        if ( !arguments.length ) 
     2614            return queue( this[0], type ); 
     2615 
    22832616        return this.each(function(){ 
    2284             if ( !this.queue ) 
    2285                 this.queue = {}; 
    2286      
    2287             if ( !this.queue[type] ) 
    2288                 this.queue[type] = []; 
    2289      
    2290             this.queue[type].push( fn ); 
    2291          
    2292             if ( this.queue[type].length == 1 ) 
    2293                 fn.apply(this); 
     2617            if ( fn.constructor == Array ) 
     2618                queue(this, type, fn); 
     2619            else { 
     2620                queue(this, type).push( fn ); 
     2621             
     2622                if ( queue(this, type).length == 1 ) 
     2623                    fn.apply(this); 
     2624            } 
    22942625        }); 
     2626    }, 
     2627 
     2628    stop: function(){ 
     2629        var timers = jQuery.timers; 
     2630 
     2631        return this.each(function(){ 
     2632            for ( var i = 0; i < timers.length; i++ ) 
     2633                if ( timers[i].elem == this ) 
     2634                    timers.splice(i--, 1); 
     2635        }).dequeue(); 
    22952636    } 
    22962637 
    22972638}); 
     2639 
     2640var queue = function( elem, type, array ) { 
     2641    if ( !elem ) 
     2642        return; 
     2643 
     2644    var q = jQuery.data( elem, type + "queue" ); 
     2645 
     2646    if ( !q || array ) 
     2647        q = jQuery.data( elem, type + "queue",  
     2648            array ? jQuery.makeArray(array) : [] ); 
     2649 
     2650    return q; 
     2651}; 
     2652 
     2653jQuery.fn.dequeue = function(type){ 
     2654    type = type || "fx"; 
     2655 
     2656    return this.each(function(){ 
     2657        var q = queue(this, type); 
     2658 
     2659        q.shift(); 
     2660 
     2661        if ( q.length ) 
     2662            q[0].apply( this ); 
     2663    }); 
     2664}; 
    22982665 
    22992666jQuery.extend({ 
     
    23142681        opt.old = opt.complete; 
    23152682        opt.complete = function(){ 
    2316             jQuery.dequeue(this, "fx"); 
     2683            jQuery(this).dequeue(); 
    23172684            if ( jQuery.isFunction( opt.old ) ) 
    23182685                opt.old.apply( this ); 
     
    23312698    }, 
    23322699     
    2333     queue: {}, 
    2334      
    2335     dequeue: function(elem,type){ 
    2336         type = type || "fx"; 
    2337      
    2338         if ( elem.queue && elem.queue[type] ) { 
    2339             // Remove self 
    2340             elem.queue[type].shift(); 
    2341      
    2342             // Get next function 
    2343             var f = elem.queue[type][0]; 
     2700    timers: [], 
     2701 
     2702    fx: function( elem, options, prop ){ 
     2703        this.options = options; 
     2704        this.elem = elem; 
     2705        this.prop = prop; 
     2706 
     2707        if ( !options.orig ) 
     2708            options.orig = {}; 
     2709    } 
     2710 
     2711}); 
     2712 
     2713jQuery.fx.prototype = { 
     2714 
     2715    // Simple function for setting a style value 
     2716    update: function(){ 
     2717        if ( this.options.step ) 
     2718            this.options.step.apply( this.elem, [ this.now, this ] ); 
     2719 
     2720        (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); 
     2721 
     2722        // Set display property to block for height/width animations 
     2723        if ( this.prop == "height" || this.prop == "width" ) 
     2724            this.elem.style.display = "block"; 
     2725    }, 
     2726 
     2727    // Get the current size 
     2728    cur: function(force){ 
     2729        if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null ) 
     2730            return this.elem[ this.prop ]; 
     2731 
     2732        var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force)); 
     2733        return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0; 
     2734    }, 
     2735 
     2736    // Start an animation from one number to another 
     2737    custom: function(from, to, unit){ 
     2738        this.startTime = (new Date()).getTime(); 
     2739        this.start = from; 
     2740        this.end = to; 
     2741        this.unit = unit || this.unit || "px"; 
     2742        this.now = this.start; 
     2743        this.pos = this.state = 0; 
     2744        this.update(); 
     2745 
     2746        var self = this; 
     2747        function t(){ 
     2748            return self.step(); 
     2749        } 
     2750 
     2751        t.elem = this.elem; 
     2752 
     2753        jQuery.timers.push(t); 
     2754 
     2755        if ( jQuery.timers.length == 1 ) { 
     2756            var timer = setInterval(function(){ 
     2757                var timers = jQuery.timers; 
     2758                 
     2759                for ( var i = 0; i < timers.length; i++ ) 
     2760                    if ( !timers[i]() ) 
     2761                        timers.splice(i--, 1); 
     2762 
     2763                if ( !timers.length ) 
     2764                    clearInterval( timer ); 
     2765            }, 13); 
     2766        } 
     2767    }, 
     2768 
     2769    // Simple 'show' function 
     2770    show: function(){ 
     2771        // Remember where we started, so that we can go back to it later 
     2772        this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); 
     2773        this.options.show = true; 
     2774 
     2775        // Begin the animation 
     2776        this.custom(0, this.cur()); 
     2777 
     2778        // Make sure that we start at a small width/height to avoid any 
     2779        // flash of content 
     2780        if ( this.prop == "width" || this.prop == "height" ) 
     2781            this.elem.style[this.prop] = "1px"; 
    23442782         
    2345             if ( f ) f.apply( elem ); 
    2346         } 
    2347     }, 
    2348  
    2349     timers: [], 
    2350  
    2351     /* 
    2352      * I originally wrote fx() as a clone of moo.fx and in the process 
    2353      * of making it small in size the code became illegible to sane 
    2354      * people. You've been warned. 
    2355      */ 
    2356      
    2357     fx: function( elem, options, prop ){ 
    2358  
    2359         var z = this; 
    2360  
    2361         // The styles 
    2362         var y = elem.style; 
     2783        // Start by showing the element 
     2784        jQuery(this.elem).show(); 
     2785    }, 
     2786 
     2787    // Simple 'hide' function 
     2788    hide: function(){ 
     2789        // Remember where we started, so that we can go back to it later 
     2790        this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); 
     2791        this.options.hide = true; 
     2792 
     2793        // Begin the animation 
     2794        this.custom(this.cur(), 0); 
     2795    }, 
     2796 
     2797    // Each step of an animation 
     2798    step: function(){ 
     2799        var t = (new Date()).getTime(); 
     2800 
     2801        if ( t > this.options.duration + this.startTime ) { 
     2802            this.now = this.end; 
     2803            this.pos = this.state = 1; 
     2804            this.update(); 
     2805 
     2806            this.options.curAnim[ this.prop ] = true; 
     2807 
     2808            var done = true; 
     2809            for ( var i in this.options.curAnim ) 
     2810                if ( this.options.curAnim[i] !== true ) 
     2811                    done = false; 
     2812 
     2813            if ( done ) { 
     2814                if ( this.options.display != null ) { 
     2815                    // Reset the overflow 
     2816                    this.elem.style.overflow = this.options.overflow; 
     2817                 
     2818                    // Reset the display 
     2819                    this.elem.style.display = this.options.display; 
     2820                    if ( jQuery.css(this.elem, "display") == "none" ) 
     2821                        this.elem.style.display = "block"; 
     2822                } 
     2823 
     2824                // Hide the element if the "hide" operation was done 
     2825                if ( this.options.hide ) 
     2826                    this.elem.style.display = "none"; 
     2827 
     2828                // Reset the properties, if the item has been hidden or shown 
     2829                if ( this.options.hide || this.options.show ) 
     2830                    for ( var p in this.options.curAnim ) 
     2831                        jQuery.attr(this.elem.style, p, this.options.orig[p]); 
     2832            } 
     2833 
     2834            // If a callback was provided, execute it 
     2835            if ( done && jQuery.isFunction( this.options.complete ) ) 
     2836                // Execute the complete function 
     2837                this.options.complete.apply( this.elem ); 
     2838 
     2839            return false; 
     2840        } else { 
     2841            var n = t - this.startTime; 
     2842            this.state = n / this.options.duration; 
     2843 
     2844            // Perform the easing function, defaults to swing 
     2845            this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); 
     2846            this.now = this.start + ((this.end - this.start) * this.pos); 
     2847 
     2848            // Perform the next step of the animation 
     2849            this.update(); 
     2850        } 
     2851 
     2852        return true; 
     2853    } 
     2854 
     2855}; 
     2856 
     2857jQuery.fx.step = { 
     2858    scrollLeft: function(fx){ 
     2859        fx.elem.scrollLeft = fx.now; 
     2860    }, 
     2861 
     2862    scrollTop: function(fx){ 
     2863        fx.elem.scrollTop = fx.now; 
     2864    }, 
     2865 
     2866    opacity: function(fx){ 
     2867        jQuery.attr(fx.elem.style, "opacity", fx.now); 
     2868    }, 
     2869 
     2870    _default: function(fx){ 
     2871        fx.elem.style[ fx.prop ] = fx.now + fx.unit; 
     2872    } 
     2873}; 
     2874// The Offset Method 
     2875// Originally By Brandon Aaron, part of the Dimension Plugin 
     2876// http://jquery.com/plugins/project/dimensions 
     2877jQuery.fn.offset = function() { 
     2878    var left = 0, top = 0, elem = this[0], results; 
     2879     
     2880    if ( elem ) with ( jQuery.browser ) { 
     2881        var absolute    = jQuery.css(elem, "position") == "absolute",  
     2882                parent      = elem.parentNode,  
     2883                offsetParent    = elem.offsetParent,  
     2884                doc     = elem.ownerDocument, 
     2885            safari2     = safari && !absolute && parseInt(version) < 522; 
     2886     
     2887        // Use getBoundingClientRect if available 
     2888        if ( elem.getBoundingClientRect ) { 
     2889            box = elem.getBoundingClientRect(); 
    23632890         
    2364         // Simple function for setting a style value 
    2365         z.a = function(){ 
    2366             if ( options.step ) 
    2367                 options.step.apply( elem, [ z.now ] ); 
    2368  
    2369             if ( prop == "opacity" ) 
    2370                 jQuery.attr(y, "opacity", z.now); // Let attr handle opacity 
    2371             else { 
    2372                 y[prop] = parseInt(z.now) + "px"; 
    2373  
    2374                 // Set display property to block for height/width animations 
    2375                 if ( prop == "height" || prop == "width" ) 
    2376                     y.display = "block"; 
    2377             } 
    2378         }; 
    2379  
    2380         // Figure out the maximum number to run to 
    2381         z.max = function(){ 
    2382             return parseFloat( jQuery.css(elem,prop) ); 
    2383         }; 
    2384  
    2385         // Get the current size 
    2386         z.cur = function(){ 
    2387             var r = parseFloat( jQuery.curCSS(elem, prop) ); 
    2388             return r && r > -10000 ? r : z.max(); 
    2389         }; 
    2390  
    2391         // Start an animation from one number to another 
    2392         z.custom = function(from,to){ 
    2393             z.startTime = (new Date()).getTime(); 
    2394             z.now = from; 
    2395             z.a(); 
    2396  
    2397             jQuery.timers.push(function(){ 
    2398                 return z.step(from, to); 
    2399             }); 
    2400  
    2401             if ( jQuery.timers.length == 1 ) { 
    2402                 var timer = setInterval(function(){ 
    2403                     var timers = jQuery.timers; 
    2404                      
    2405                     for ( var i = 0; i < timers.length; i++ ) 
    2406                         if ( !timers[i]() ) 
    2407                             timers.splice(i--, 1); 
    2408  
    2409                     if ( !timers.length ) 
    2410                         clearInterval( timer ); 
    2411                 }, 13); 
    2412             } 
    2413         }; 
    2414  
    2415         // Simple 'show' function 
    2416         z.show = function(){ 
    2417             if ( !elem.orig ) elem.orig = {}; 
    2418  
    2419             // Remember where we started, so that we can go back to it later 
    2420             elem.orig[prop] = jQuery.attr( elem.style, prop ); 
    2421  
    2422             options.show = true; 
    2423  
    2424             // Begin the animation 
    2425             z.custom(0, this.cur()); 
    2426  
    2427             // Make sure that we start at a small width/height to avoid any 
    2428             // flash of content 
    2429             if ( prop != "opacity" ) 
    2430                 y[prop] = "1px"; 
     2891            // Add the document scroll offsets 
     2892            add( 
     2893                box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), 
     2894                box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop) 
     2895            ); 
     2896         
     2897            // IE adds the HTML element's border, by default it is medium which is 2px 
     2898            // IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; } 
     2899            // IE 7 standards mode, the border is always 2px 
     2900            if ( msie ) { 
     2901                var border = jQuery("html").css("borderWidth"); 
     2902                border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border; 
     2903                add( -border, -border ); 
     2904            } 
     2905     
     2906        // Otherwise loop through the offsetParents and parentNodes 
     2907        } else { 
     2908         
     2909            // Initial element offsets 
     2910            add( elem.offsetLeft, elem.offsetTop ); 
     2911         
     2912            // Get parent offsets 
     2913            while ( offsetParent ) { 
     2914                // Add offsetParent offsets 
     2915                add( offsetParent.offsetLeft, offsetParent.offsetTop ); 
    24312916             
    2432             // Start by showing the element 
    2433             jQuery(elem).show(); 
    2434         }; 
    2435  
    2436         // Simple 'hide' function 
    2437         z.hide = function(){ 
    2438             if ( !elem.orig ) elem.orig = {}; 
    2439  
    2440             // Remember where we started, so that we can go back to it later 
    2441             elem.orig[prop] = jQuery.attr( elem.style, prop ); 
    2442  
    2443             options.hide = true; 
    2444  
    2445             // Begin the animation 
    2446             z.custom(this.cur(), 0); 
    2447         }; 
    2448  
    2449         // Each step of an animation 
    2450         z.step = function(firstNum, lastNum){ 
    2451             var t = (new Date()).getTime(); 
    2452  
    2453             if (t > options.duration + z.startTime) { 
    2454                 z.now = lastNum; 
    2455                 z.a(); 
    2456  
    2457                 if (elem.curAnim) elem.curAnim[ prop ] = true; 
    2458  
    2459                 var done = true; 
    2460                 for ( var i in elem.curAnim ) 
    2461                     if ( elem.curAnim[i] !== true ) 
    2462                         done = false; 
    2463  
    2464                 if ( done ) { 
    2465                     if ( options.display != null ) { 
    2466                         // Reset the overflow 
    2467                         y.overflow = options.overflow; 
    2468                      
    2469                         // Reset the display 
    2470                         y.display = options.display; 
    2471                         if ( jQuery.css(elem, "display") == "none" ) 
    2472                             y.display = "block"; 
    2473                     } 
    2474  
    2475                     // Hide the element if the "hide" operation was done 
    2476                     if ( options.hide ) 
    2477                         y.display = "none"; 
    2478  
    2479                     // Reset the properties, if the item has been hidden or shown 
    2480                     if ( options.hide || options.show ) 
    2481                         for ( var p in elem.curAnim ) 
    2482                             jQuery.attr(y, p, elem.orig[p]); 
    2483                 } 
    2484  
    2485                 // If a callback was provided, execute it 
    2486                 if ( done && jQuery.isFunction( options.complete ) ) 
    2487                     // Execute the complete function 
    2488                     options.complete.apply( elem ); 
    2489  
    2490                 return false; 
    2491             } else { 
    2492                 var n = t - this.startTime; 
    2493                 // Figure out where in the animation we are and set the number 
    2494                 var p = n / options.duration; 
     2917                // Mozilla and Safari > 2 does not include the border on offset parents 
     2918                // However Mozilla adds the border for table cells 
     2919                if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 ) 
     2920                    border( offsetParent ); 
    24952921                 
    2496                 // Perform the easing function, defaults to swing 
    2497                 z.now = jQuery.easing[options.easing || (jQuery.easing.swing ? "swing" : "linear")](p, n, firstNum, (lastNum-firstNum), options.duration); 
    2498  
    2499                 // Perform the next step of the animation 
    2500                 z.a(); 
    2501             } 
    2502  
    2503             return true; 
    2504         }; 
    2505      
     2922                // Safari <= 2 doubles body offsets with an absolutely positioned element or parent 
     2923                if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" ) 
     2924                    absolute = true; 
     2925             
     2926                // Get next offsetParent 
     2927                offsetParent = offsetParent.offsetParent; 
     2928            } 
     2929         
     2930            // Get parent scroll offsets 
     2931            while ( parent.tagName && /^body|html$/i.test(parent.tagName) ) { 
     2932                // Work around opera inline/table scrollLeft/Top bug 
     2933                if ( /^inline|table-row.*$/i.test(jQuery.css(parent, "display")) ) 
     2934                    // Subtract parent scroll offsets 
     2935                    add( -parent.scrollLeft, -parent.scrollTop ); 
     2936             
     2937                // Mozilla does not add the border for a parent that has overflow != visible 
     2938                if ( mozilla && jQuery.css(parent, "overflow") != "visible" ) 
     2939                    border( parent ); 
     2940             
     2941                // Get next parent 
     2942                parent = parent.parentNode; 
     2943            } 
     2944         
     2945            // Safari doubles body offsets with an absolutely positioned element or parent 
     2946            if ( safari && absolute ) 
     2947                add( -doc.body.offsetLeft, -doc.body.offsetTop ); 
     2948        } 
     2949 
     2950        // Return an object with top and left properties 
     2951        results = { top: top, left: left }; 
    25062952    } 
    2507 }); 
     2953 
     2954    return results; 
     2955 
     2956    function border(elem) { 
     2957        add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") ); 
     2958    } 
     2959 
     2960    function add(l, t) { 
     2961        left += parseInt(l) || 0; 
     2962        top += parseInt(t) || 0; 
     2963    } 
     2964}; 
    25082965})(); 
Note: See TracChangeset for help on using the changeset viewer.