1 2 3 4 5 6 7
Object.extend(Element, { condClassName : function (element, className, cond) { (cond?Element.addClassName:Element.removeClassName)(element,className); } });