ÿþ/ / * * *   T h i s   c o d e   i s   c o p y r i g h t   2 0 0 2 - 2 0 0 3   b y   G a v i n   K i s t n e r   a n d   R e f i n e r y ;   w w w . r e f i n e r y . c o m  
 / / * * *   I t   i s   c o v e r e d   u n d e r   t h e   l i c e n s e   v i e w a b l e   a t   h t t p : / / p h r o g z . n e t / J S / _ R e u s e L i c e n s e . t x t  
 / / * * *   R e u s e   o r   m o d i f i c a t i o n   i s   f r e e   p r o v i d e d   y o u   a b i d e   b y   t h e   t e r m s   o f   t h a t   l i c e n s e .  
 / / * * *   ( I n c l u d i n g   t h e   f i r s t   t w o   l i n e s   a b o v e   i n   y o u r   s o u r c e   c o d e   s a t i s f i e s   t h e   c o n d i t i o n s . )  
  
 / / * * * A d d s   a   n e w   c l a s s   t o   a n   o b j e c t ,   p r e s e r v i n g   e x i s t i n g   c l a s s e s  
 f u n c t i o n   A d d C l a s s ( o b j , c N a m e ) {   K i l l C l a s s ( o b j , c N a m e ) ;   r e t u r n   o b j   & &   ( o b j . c l a s s N a m e + = ( o b j . c l a s s N a m e . l e n g t h > 0 ? '   ' : ' ' ) + c N a m e ) ;   }  
  
 / / * * * R e m o v e s   a   p a r t i c u l a r   c l a s s   f r o m   a n   o b j e c t ,   p r e s e r v i n g   o t h e r   e x i s t i n g   c l a s s e s .  
 f u n c t i o n   K i l l C l a s s ( o b j , c N a m e ) {   r e t u r n   o b j   & &   ( o b j . c l a s s N a m e = o b j . c l a s s N a m e . r e p l a c e ( n e w   R e g E x p ( " ^ " + c N a m e + " \ \ b \ \ s * | \ \ s * \ \ b " + c N a m e + " \ \ b " , ' g ' ) , ' ' ) ) ;   }  
  
 / / * * * R e t u r n s   t r u e   i f   t h e   o b j e c t   h a s   t h e   c l a s s   a s s i g n e d ,   f a l s e   o t h e r w i s e .  
 f u n c t i o n   H a s C l a s s ( o b j , c N a m e ) {   r e t u r n   ( ! o b j   | |   ! o b j . c l a s s N a m e ) ? f a l s e : ( n e w   R e g E x p ( " \ \ b " + c N a m e + " \ \ b " ) ) . t e s t ( o b j . c l a s s N a m e )   }  
 
