/*
Copyright 2010, KISSY UI Library v1.0.8
MIT Licensed
build: 811 Jul 7 23:02
*/
KISSY.add("node",function(a){function f(d,c,h){var k;if(!(this instanceof f))return new f(d,c,h);if(!d)return null;if(e._isElementNode(d))k=d;else if(typeof d==="string")k=e.create(d,c,h);this[0]=k}var e=a.DOM;a.augment(f,{length:1,getDOMNode:function(){return this[0]}});a.one=function(d,c){return new f(a.get(d,c))};a.Node=f});
KISSY.add("nodelist",function(a){function f(c){if(!(this instanceof f))return new f(c);d.push.apply(this,c||[])}var e=a.DOM,d=Array.prototype;a.mix(f.prototype,{length:0,item:function(c){var h=null;if(e._isElementNode(this[c]))h=new a.Node(this[c]);return h},getDOMNodes:function(){return d.slice.call(this)},each:function(c,h){for(var k=this.length,i=0,l;i<k;++i){l=new a.Node(this[i]);c.call(h||l,l,i,this)}return this}});a.all=function(c,h){return new f(a.query(c,h,true))};a.NodeList=f});
KISSY.add("node-attach",function(a,f){function e(b,p){a.each(b,function(n){a.each([h,k],function(j,m){j[n]=function(o){switch(p){case s:return function(g,q){var u=this[m?l:i]();if(q===f)return o(u,g);else{o(u,g,q);return this}};case r:return function(g){var q=this[m?l:i]();if(g===f)return o(q);else{o(q,g);return this}};case t:return function(){var g=this[m?l:i]();return(g=o.apply(d,[g].concat(a.makeArray(arguments))))?new a[g.length?"NodeList":"Node"](g):null};default:return function(){var g=this[m?
l:i]();g=o.apply(d,[g].concat(a.makeArray(arguments)));return g===f?this:g}}}(d[n])})})}var d=a.DOM,c=a.Event,h=a.Node.prototype,k=a.NodeList.prototype,i="getDOMNode",l=i+"s",s=1,r=2,t=4;a.mix(h,{one:function(b){return a.one(b,this[0])},all:function(b){return a.all(b,this[0])}});e(["hasClass","addClass","removeClass","replaceClass","toggleClass"]);e(["attr","removeAttr"],s);e(["val","text"],r);e(["css"],s);e(["width","height"],r);e(["offset"],r);e(["parent","next","prev","siblings","children"],t);
e(["contains"]);e(["html"],r);e(["remove"]);e(["insertBefore","insertAfter"],t);a.mix(h,{append:function(b){if(b=d.create(b))this[0].appendChild(b);return this},appendTo:function(b){if((b=a.get(b))&&b.appendChild)b.appendChild(this[0]);return this}});a.each([h,k],function(b){a.mix(b,a.EventTarget);b._addEvent=function(p,n){for(var j=0,m=this.length;j<m;j++)c._simpleAdd(this[j],p,n)};b._removeEvent=function(p,n){for(var j=0,m=this.length;j<m;j++)c._simpleRemove(this[j],p,n)};delete b.fire})});
