document.write('<div class="javascript" style="font-family: monospace;"><br />');
document.write('<span style="color: #003366; font-weight: bold;">var</span> classCtl=<span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; split:<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> obj.<span style="color: #006600;">className</span>.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066FF;">/ /</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>,<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; has:<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>obj,str<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> classCtl.<span style="color: #006600;">mkRE</span><span style="color: #66cc66;">&#40;</span>str,<span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">test</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">className</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>,<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; add:<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>obj,str<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">className</span>+=<span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">className</span>==<span style="color: #3366CC;">\'\'</span>?<span style="color: #3366CC;">\'\'</span>:<span style="color: #3366CC;">\' \'</span><span style="color: #66cc66;">&#41;</span>+str<span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>,<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; del:<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>obj,str<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">className</span>=<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #006600;">className</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>classCtl.<span style="color: #006600;">mkRE</span><span style="color: #66cc66;">&#40;</span>str,<span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #3366CC;">\' \'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066FF;">/<span style="color: #66cc66;">&#40;</span>^\s+|\s+$<span style="color: #66cc66;">&#41;</span>/</span>,<span style="color: #3366CC;">\'\'</span><span style="color: #66cc66;">&#41;</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; mkRE: <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>str,type<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> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #66cc66;">&#40;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">\'(^| )\'</span>+str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>/<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>\\\\\.\?\<span style="color: #66cc66;">&#40;</span>\<span style="color: #66cc66;">&#41;</span>\<span style="color: #66cc66;">&#123;</span>\<span style="color: #66cc66;">&#125;</span>\<span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\'</span><span style="color: #000099; font-weight: bold;">\+</span><span style="color: #000099; font-weight: bold;">\*</span><span style="color: #000099; font-weight: bold;">\^</span><span style="color: #000099; font-weight: bold;">\$</span>])/g,\'<span style="color: #000099; font-weight: bold;">\\</span>$1\')+\'( |$)\',<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type?\'i\':\'ig\'<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; }<br />');
document.write('}<br />');
document.write('&nbsp;</span></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/667/1/" target="_blank">byteMyCode</a>.</div>');
