foswiki.CSS={removeClass:function(c,d){if(!c){return}var b=foswiki.CSS.getClassList(c);if(!b){return}var a=foswiki.CSS._indexOf(b,d);if(a>=0){b.splice(a,1);foswiki.CSS.setClassList(c,b)}},addClass:function(b,c){if(!b){return}var a=foswiki.CSS.getClassList(b);if(!a){return}if(foswiki.CSS._indexOf(a,c)<0){a[a.length]=c;foswiki.CSS.setClassList(b,a)}},replaceClass:function(b,a,c){if(!b){return}foswiki.CSS.removeClass(b,a);foswiki.CSS.addClass(b,c)},getClassList:function(a){if(!a){return}if(a.className&&a.className!=""){return a.className.split(" ")}return[]},setClassList:function(a,b){if(!a){return}a.className=b.join(" ")},hasClass:function(b,c){if(!b){return}if(b.className){var a=foswiki.CSS.getClassList(b);if(a){return(foswiki.CSS._indexOf(a,c)>=0)}return false}},_indexOf:function(d,c){if(!d||d.length==undefined){return null}var b,a=d.length;for(b=0;b<a;++b){if(d[b]==c){return b}}return -1}};