/* Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ //>>built define("dojo/dom-class",["./_base/lang","./_base/array","./dom"],function(_1,_2,_3){ var _4="className"; var _5,_6=/\s+/,a1=[""]; function _7(s){ if(typeof s=="string"||s instanceof String){ if(s&&!_6.test(s)){ a1[0]=s; return a1; } var a=s.split(_6); if(a.length&&!a[0]){ a.shift(); } if(a.length&&!a[a.length-1]){ a.pop(); } return a; } if(!s){ return []; } return _2.filter(s,function(x){ return x; }); }; var _8={}; _5={contains:function containsClass(_9,_a){ return ((" "+_3.byId(_9)[_4]+" ").indexOf(" "+_a+" ")>=0); },add:function addClass(_b,_c){ _b=_3.byId(_b); _c=_7(_c); var _d=_b[_4],_e; _d=_d?" "+_d+" ":" "; _e=_d.length; for(var i=0,_f=_c.length,c;i<_f;++i){ c=_c[i]; if(c&&_d.indexOf(" "+c+" ")<0){ _d+=c+" "; } } if(_e<_d.length){ _b[_4]=_d.substr(1,_d.length-2); } },remove:function removeClass(_10,_11){ _10=_3.byId(_10); var cls; if(_11!==undefined){ _11=_7(_11); cls=" "+_10[_4]+" "; for(var i=0,len=_11.length;i