+ /**
+ * Execute a function within the context of every matched element.
+ * This means that every time the passed-in function is executed
+ * (which is once for every element matched) the 'this' keyword
+ * points to the specific element.
+ *
+ * Additionally, the function, when executed, is passed a single
+ * argument representing the position of the element in the matched
+ * set.
+ *
+ * @example $("img").each(function(){ this.src = "test.jpg"; });
+ * @before <img/> <img/>
+ * @result <img src="test.jpg"/> <img src="test.jpg"/>
+ *
+ * @name each
+ * @type jQuery
+ * @param Function fn A function to execute
+ */
+ each: function( fn, args ) {
+ // Iterate through all of the matched elements
+ for ( var i = 0; i < this.length; i++ )
+
+ // Execute the function within the context of each element
+ fn.apply( this[i], args || [i] );
+
+ return this;
+ },
+
+ /**
+ * Access a property on the first matched element.
+ * This method makes it easy to retreive a property value
+ * from the first matched element.
+ *
+ * @example $("img").attr("src");
+ * @before <img src="test.jpg"/>
+ * @result test.jpg
+ *
+ * @name attr
+ * @type Object
+ * @param String name The name of the property to access.
+ */
+
+ /**
+ * Set a hash of key/value object properties to all matched elements.
+ * This serves as the best way to set a large number of properties
+ * on all matched elements.
+ *
+ * @example $("img").attr({ src: "test.jpg", alt: "Test Image" });
+ * @before <img/>
+ * @result <img src="test.jpg" alt="Test Image"/>
+ *
+ * @name attr
+ * @type jQuery
+ * @param Hash prop A set of key/value pairs to set as object properties.
+ */
+
+ /**
+ * Set a single property to a value, on all matched elements.
+ *
+ * @example $("img").attr("src","test.jpg");
+ * @before <img/>
+ * @result <img src="test.jpg"/>
+ *
+ * @name attr
+ * @type jQuery
+ * @param String key The name of the property to set.
+ * @param Object value The value to set the property to.
+ */
+ attr: function( key, value, type ) {
+ // Check to see if we're setting style values
+ return key.constructor != String || value ?
+ this.each(function(){
+ // See if we're setting a hash of styles
+ if ( value == undefined )
+ // Set all the styles
+ for ( var prop in key )
+ jQuery.attr(
+ type ? this.style : this,
+ prop, key[prop]
+ );
+
+ // See if we're setting a single key/value style
+ else
+ jQuery.attr(
+ type ? this.style : this,
+ key, value
+ );
+ }) :
+
+ // Look for the case where we're accessing a style value
+ jQuery[ type || "attr" ]( this[0], key );
+ },
+
+ /**
+ * Access a style property on the first matched element.
+ * This method makes it easy to retreive a style property value
+ * from the first matched element.
+ *
+ * @example $("p").css("red");
+ * @before <p style="color:red;">Test Paragraph.</p>
+ * @result red
+ *
+ * @name css
+ * @type Object
+ * @param String name The name of the property to access.
+ */
+
+ /**
+ * Set a hash of key/value style properties to all matched elements.
+ * This serves as the best way to set a large number of style properties
+ * on all matched elements.
+ *
+ * @example $("p").css({ color: "red", background: "blue" });
+ * @before <p>Test Paragraph.</p>
+ * @result <p style="color:red; background:blue;">Test Paragraph.</p>
+ *
+ * @name css
+ * @type jQuery
+ * @param Hash prop A set of key/value pairs to set as style properties.
+ */
+
+ /**
+ * Set a single style property to a value, on all matched elements.
+ *
+ * @example $("p").css("color","red");
+ * @before <p>Test Paragraph.</p>
+ * @result <p style="color:red;">Test Paragraph.</p>
+ *
+ * @name css
+ * @type jQuery
+ * @param String key The name of the property to set.
+ * @param Object value The value to set the property to.
+ */
+ css: function( key, value ) {
+ return this.attr( key, value, "css" );
+ },
+
+ /**
+ * Retreive the text contents of all matched elements. The result is
+ * a string that contains the combined text contents of all matched
+ * elements. This method works on both HTML and XML documents.
+ *
+ * @example $("p").text();
+ * @before <p>Test Paragraph.</p>
+ * @result Test Paragraph.
+ *
+ * @name text
+ * @type String
+ */
+ text: function(e) {
+ e = e || this;
+ var t = "";
+ for ( var j = 0; j < e.length; j++ ) {
+ var r = e[j].childNodes;
+ for ( var i = 0; i < r.length; i++ )
+ t += r[i].nodeType != 1 ?
+ r[i].nodeValue : jQuery.fn.text([ r[i] ]);
+ }
+ return t;
+ },
+
+ /**
+ * Wrap all matched elements with a structure of other elements.
+ * This wrapping process is most useful for injecting additional
+ * stucture into a document, without ruining the original semantic
+ * qualities of a document.
+ *
+ * The way that is works is that it goes through the first element argument
+ * provided and finds the deepest element within the structure - it is that
+ * element that will en-wrap everything else.
+ *
+ * @example $("p").wrap("<div class='wrap'></div>");
+ * @before <p>Test Paragraph.</p>
+ * @result <div class='wrap'><p>Test Paragraph.</p></div>
+ *
+ * @name wrap
+ * @type jQuery
+ * @any String html A string of HTML, that will be created on the fly and wrapped around the target.
+ * @any Element elem A DOM element that will be wrapped.
+ * @any Array<Element> elems An array of elements, the first of which will be wrapped.
+ * @any Object obj Any object, converted to a string, then a text node.
+ */
+ wrap: function() {
+ // The elements to wrap the target around
+ var a = jQuery.clean(arguments);
+
+ // Wrap each of the matched elements individually
+ return this.each(function(){
+ // Clone the structure that we're using to wrap
+ var b = a[0].cloneNode(true);
+
+ // Insert it before the element to be wrapped
+ this.parentNode.insertBefore( b, this );
+
+ // Find he deepest point in the wrap structure
+ while ( b.firstChild )
+ b = b.firstChild;
+
+ // Move the matched element to within the wrap structure
+ b.appendChild( this );
+ });
+ },
+
+ /**
+ * Append any number of elements to the inside of all matched elements.
+ * This operation is similar to doing an <tt>appendChild</tt> to all the
+ * specified elements, adding them into the document.
+ *
+ * @example $("p").append("<b>Hello</b>");
+ * @before <p>I would like to say: </p>
+ * @result <p>I would like to say: <b>Hello</b></p>
+ *
+ * @name append
+ * @type jQuery
+ * @any String html A string of HTML, that will be created on the fly and appended to the target.
+ * @any Element elem A DOM element that will be appended.
+ * @any Array<Element> elems An array of elements, all of which will be appended.
+ * @any Object obj Any object, converted to a string, then a text node.
+ */
+ append: function() {
+ return this.domManip(arguments, true, 1, function(a){
+ this.appendChild( a );
+ });
+ },
+
+ /**
+ * Prepend any number of elements to the inside of all matched elements.
+ * This operation is the best way to insert a set of elements inside, at the
+ * beginning, of all the matched element.
+ *
+ * @example $("p").prepend("<b>Hello</b>");
+ * @before <p>, how are you?</p>
+ * @result <p><b>Hello</b>, how are you?</p>
+ *
+ * @name prepend
+ * @type jQuery
+ * @any String html A string of HTML, that will be created on the fly and prepended to the target.
+ * @any Element elem A DOM element that will be prepended.
+ * @any Array<Element> elems An array of elements, all of which will be prepended.
+ * @any Object obj Any object, converted to a string, then a text node.
+ */
+ prepend: function() {
+ return this.domManip(arguments, true, -1, function(a){
+ this.insertBefore( a, this.firstChild );
+ });
+ },
+
+ /**
+ * Insert any number of elements before each of the matched elements.
+ *
+ * @example $("p").before("<b>Hello</b>");
+ * @before <p>how are you?</p>
+ * @result <b>Hello</b><p>how are you?</p>
+ *
+ * @name before
+ * @type jQuery
+ * @any String html A string of HTML, that will be created on the fly and inserted.
+ * @any Element elem A DOM element that will beinserted.
+ * @any Array<Element> elems An array of elements, all of which will be inserted.
+ * @any Object obj Any object, converted to a string, then a text node.
+ */
+ before: function() {
+ return this.domManip(arguments, false, 1, function(a){
+ this.parentNode.insertBefore( a, this );
+ });
+ },
+
+ /**
+ * Insert any number of elements after each of the matched elements.
+ *
+ * @example $("p").after("<p>I'm doing fine.</p>");
+ * @before <p>How are you?</p>
+ * @result <p>How are you?</p><p>I'm doing fine.</p>
+ *
+ * @name after
+ * @type jQuery
+ * @any String html A string of HTML, that will be created on the fly and inserted.
+ * @any Element elem A DOM element that will beinserted.
+ * @any Array<Element> elems An array of elements, all of which will be inserted.
+ * @any Object obj Any object, converted to a string, then a text node.
+ */
+ after: function() {
+ return this.domManip(arguments, false, -1, function(a){
+ this.parentNode.insertBefore( a, this.nextSibling );
+ });
+ },
+
+ /**
+ * End the most recent 'destructive' operation, reverting the list of matched elements
+ * back to its previous state. After an end operation, the list of matched elements will
+ * revert to the last state of matched elements.
+ *
+ * @example $("p").find("span").end();
+ * @before <p><span>Hello</span>, how are you?</p>
+ * @result $("p").find("span").end() == [ <p>...</p> ]
+ *
+ * @name end
+ * @type jQuery
+ */
+ end: function() {
+ return this.get( this.stack.pop() );
+ },
+
+ /**
+ * Searches for all elements that match the specified expression.
+ * This method is the optimal way of finding additional descendant
+ * elements with which to process.
+ *
+ * All searching is done using a jQuery expression. The expression can be
+ * written using CSS 1-3 Selector syntax, or basic XPath.
+ *
+ * @example $("p").find("span");
+ * @before <p><span>Hello</span>, how are you?</p>
+ * @result $("p").find("span") == [ <span>Hello</span> ]
+ *
+ * @name find
+ * @type jQuery
+ * @param String expr An expression to search with.
+ */
+ find: function(t) {
+ return this.pushStack( jQuery.map( this, function(a){
+ return jQuery.find(t,a);
+ }), arguments );
+ },
+
+ /**
+ * Removes all elements from the set of matched elements that do not
+ * match the specified expression. This method is used to narrow down
+ * the results of a search.
+ *
+ * All searching is done using a jQuery expression. The expression
+ * can be written using CSS 1-3 Selector syntax, or basic XPath.
+ *
+ * @example $("p").filter(".selected")
+ * @before <p class="selected">Hello</p><p>How are you?</p>
+ * @result $("p").filter(".selected") == [ <p class="selected">Hello</p> ]
+ *
+ * @name filter
+ * @type jQuery
+ * @param String expr An expression to search with.
+ */
+
+ /**
+ * Removes all elements from the set of matched elements that do not
+ * match at least one of the expressions passed to the function. This
+ * method is used when you want to filter the set of matched elements
+ * through more than one expression.
+ *
+ * Elements will be retained in the jQuery object if they match at
+ * least one of the expressions passed.
+ *
+ * @example $("p").filter([".selected", ":first"])
+ * @before <p>Hello</p><p>Hello Again</p><p class="selected">And Again</p>
+ * @result $("p").filter([".selected", ":first"]) == [ <p>Hello</p>, <p class="selected">And Again</p> ]
+ *
+ * @name filter
+ * @type jQuery
+ * @param Array<String> exprs A set of expressions to evaluate against
+ */
+ filter: function(t) {
+ return this.pushStack(
+ t.constructor == Array &&
+ jQuery.map(this,function(a){
+ for ( var i = 0; i < t.length; i++ )
+ if ( jQuery.filter(t[i],[a]).r.length )
+ return a;
+ }) ||
+
+ t.constructor == Boolean &&
+ ( t ? this.get() : [] ) ||
+
+ t.constructor == Function &&
+ jQuery.grep( this, t ) ||
+
+ jQuery.filter(t,this).r, arguments );
+ },
+
+ /**
+ * Removes the specified Element from the set of matched elements. This
+ * method is used to remove a single Element from a jQuery object.
+ *
+ * @example $("p").not( document.getElementById("selected") )
+ * @before <p>Hello</p><p id="selected">Hello Again</p>
+ * @result [ <p>Hello</p> ]
+ *
+ * @name not
+ * @type jQuery
+ * @param Element el An element to remove from the set
+ */
+
+ /**
+ * Removes elements matching the specified expression from the set
+ * of matched elements. This method is used to remove one or more
+ * elements from a jQuery object.
+ *
+ * @example $("p").not("#selected")
+ * @before <p>Hello</p><p id="selected">Hello Again</p>
+ * @result [ <p>Hello</p> ]
+ *
+ * @name not
+ * @type jQuery
+ * @param String expr An expression with which to remove matching elements
+ */
+ not: function(t) {
+ return this.pushStack( t.constructor == String ?
+ jQuery.filter(t,this,false).r :
+ jQuery.grep(this,function(a){ return a != t; }), arguments );
+ },