document.write('<div class="javascript" style="font-family: monospace;"><br />');
document.write('<br />');
document.write('<span style="color: #003366; font-weight: bold;">var</span> CSSUtils = <span style="color: #66cc66;">&#123;</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; hasClass: <span style="color: #009900; font-style: italic;">/*static*/</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>element_, cName_<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> _regExp = <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #66cc66;">&#40;</span>cName_, <span style="color: #3366CC;">&quot;gi&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> element_ &amp;&amp; _regExp.<span style="color: #006600;">test</span><span style="color: #66cc66;">&#40;</span>element_.<span style="color: #006600;">className</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>,<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; hasNotClass: <span style="color: #009900; font-style: italic;">/*static*/</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>element_, cName_<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> !CSSUtils.<span style="color: #006600;">hasClass</span><span style="color: #66cc66;">&#40;</span>element_, cName_<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>,<br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; addClass: <span style="color: #009900; font-style: italic;">/*static*/</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>element_, cName_<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>element_<span style="color: #66cc66;">&#41;</span> element_.<span style="color: #006600;">className</span> = element_.<span style="color: #006600;">className</span>.<span style="color: #006600;">concat</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot; &quot;</span>, cName_, <span style="color: #3366CC;">&quot; &quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>,<br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; removeClass: <span style="color: #009900; font-style: italic;">/*static*/</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>element_, cName_<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CSSUtils.<span style="color: #006600;">replaceClass</span><span style="color: #66cc66;">&#40;</span>element_, cName_, <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>,<br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; replaceClass: <span style="color: #009900; font-style: italic;">/*static*/</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>element_, cNameReplaced_, cNameReplacement_<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>CSSUtils.<span style="color: #006600;">hasClass</span><span style="color: #66cc66;">&#40;</span>cNameReplaced_<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> _regExp = <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #66cc66;">&#40;</span>cNameReplaced_, <span style="color: #3366CC;">&quot;gi&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element_.<span style="color: #006600;">className</span> = element_.<span style="color: #006600;">className</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>_regExp, cNameReplacement_<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>CSSUtils.<span style="color: #006600;">hasNotClass</span><span style="color: #66cc66;">&#40;</span>cNameReplacement_<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CSSUtils.<span style="color: #006600;">addClass</span><span style="color: #66cc66;">&#40;</span>cNameReplacement_<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('<span style="color: #66cc66;">&#125;</span>;<br />');
document.write('<br />');
document.write('&nbsp;</div>');
document.write('<br />&nbsp;<br /><div style="font-size: 12px">Brought to you by the community at <a href="http://www.bytemycode.com/snippets/snippet/241/1/" target="_blank">byteMyCode</a>.</div>');
