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