+
+ var axis = {
+ parent: "a.parentNode",
+ parents: jQuery.parents,
+ ancestors: jQuery.parents,
+ next: "a.nextSibling",
+ prev: "a.previousSibling",
+ siblings: jQuery.sibling
+ };
+
+ for ( var i in axis ) {(function(){
+ var t = axis[i];
+ jQuery.fn[ i ] = function(a) {
+ var ret = jQuery.map(this,t);
+ if ( a ) ret = jQuery.filter(a,ret).r;
+ return this.pushStack( ret, arguments );
+ };
+ })();}
+
+ var to = "html,append,prepend,before,after".split(',');
+
+ for ( var i = 0; i < to.length; i++ ) {(function(){
+ var n = to[i];
+ jQuery.fn[ n + "To" ] = function(){
+ var a = arguments;
+ return this.each(function(){
+ for ( var i = 0; i < a.length; i++ )
+ $(a[i])[n]( this );
+ });
+ };
+ })();}
+
+ var each = {
+ show: function(){
+ this.style.display = this.oldblock ? this.oldblock : "";
+ if ( jQuery.css(this,"display") == "none" )
+ this.style.display = "block";
+ },
+
+ hide: function(){
+ this.oldblock = jQuery.css(this,"display");
+ if ( this.oldblock == "none" )
+ this.oldblock = "block";
+ this.style.display = "none";
+ },
+
+ toggle: function(){
+ var d = jQuery.css(this,"display");
+ $(this)[ !d || d == "none" ? 'show' : 'hide' ]();
+ },
+
+ addClass: function(c){
+ jQuery.className.add(this,c);
+ },
+
+ removeClass: function(c){
+ jQuery.className.remove(this,c);
+ },
+
+ toggleClass: function( c ){
+ jQuery.className[ jQuery.hasWord(this,a) ? 'remove' : 'add' ](this,c);
+ },
+
+ remove: function(){
+ this.parentNode.removeChild( this );
+ },
+
+ empty: function(){
+ while ( this.firstChild )
+ this.removeChild( this.firstChild );
+ },
+
+ bind: function( type, fn ) {
+ jQuery.event.add( this, type, fn );
+ },
+
+ unbind: function( type, fn ) {
+ jQuery.event.remove( this, type, fn );
+ },
+
+ trigger: function( type ) {
+ jQuery.event.trigger( this, type );
+ },
+ };
+
+ for ( var i in each ) {(function(){
+ var n = each[i];
+ jQuery.fn[ i ] = function(a,b) {
+ var a = arguments;
+ return this.each(function(){
+ n.apply( this, a );
+ });
+ };
+ })();}
+
+ var attr = {
+ val: 'value',
+ html: 'innerHTML'
+ };
+
+ for ( var i in attr ) {(function(){
+ var n = attr[i];
+ jQuery.fn[ i ] = function(h) {
+ return h == undefined && this.length ?
+ this[0][n] : this.set( n, h );
+ };
+ })();}
+