ÿþ 
 f u n c t i o n   s e t P o i n t e r ( t h e R o w ,   t h e R o w N u m ,   t h e A c t i o n ,   t h e D e f a u l t C o l o r ,   t h e P o i n t e r C o l o r ,   t h e M a r k C o l o r )  
 {  
         v a r   t h e C e l l s   =   n u l l ;  
         v a r   m a r k e d _ r o w   =   n e w   A r r a y ;  
  
         / /   1 .   P o i n t e r   a n d   m a r k   f e a t u r e   a r e   d i s a b l e d   o r   t h e   b r o w s e r   c a n ' t   g e t   t h e  
         / /         r o w   - >   e x i t s  
         i f   ( ( t h e P o i n t e r C o l o r   = =   ' '   & &   t h e M a r k C o l o r   = =   ' ' )  
                 | |   t y p e o f ( t h e R o w . s t y l e )   = =   ' u n d e f i n e d ' )   {  
                 r e t u r n   f a l s e ;  
         }  
  
         / /   2 .   G e t s   t h e   c u r r e n t   r o w   a n d   e x i t s   i f   t h e   b r o w s e r   c a n ' t   g e t   i t  
         i f   ( t y p e o f ( d o c u m e n t . g e t E l e m e n t s B y T a g N a m e )   ! =   ' u n d e f i n e d ' )   {  
                 t h e C e l l s   =   t h e R o w . g e t E l e m e n t s B y T a g N a m e ( ' t d ' ) ;  
         }  
         e l s e   i f   ( t y p e o f ( t h e R o w . c e l l s )   ! =   ' u n d e f i n e d ' )   {  
                 t h e C e l l s   =   t h e R o w . c e l l s ;  
         }  
         e l s e   {  
                 r e t u r n   f a l s e ;  
         }  
  
         / /   3 .   G e t s   t h e   c u r r e n t   c o l o r . . .  
         v a r   r o w C e l l s C n t     =   t h e C e l l s . l e n g t h ;  
         v a r   d o m D e t e c t         =   n u l l ;  
         v a r   c u r r e n t C o l o r   =   n u l l ;  
         v a r   n e w C o l o r           =   n u l l ;  
         / /   3 . 1   . . .   w i t h   D O M   c o m p a t i b l e   b r o w s e r s   e x c e p t   O p e r a   t h a t   d o e s   n o t   r e t u r n  
         / /                   v a l i d   v a l u e s   w i t h   " g e t A t t r i b u t e "  
         i f   ( t y p e o f ( w i n d o w . o p e r a )   = =   ' u n d e f i n e d '  
                 & &   t y p e o f ( t h e C e l l s [ 0 ] . g e t A t t r i b u t e )   ! =   ' u n d e f i n e d ' )   {  
                 c u r r e n t C o l o r   =   t h e C e l l s [ 0 ] . g e t A t t r i b u t e ( ' b g c o l o r ' ) ;  
                 d o m D e t e c t         =   t r u e ;  
         }  
         / /   3 . 2   . . .   w i t h   o t h e r   b r o w s e r s  
         e l s e   {  
                 c u r r e n t C o l o r   =   t h e C e l l s [ 0 ] . s t y l e . b a c k g r o u n d C o l o r ;  
                 d o m D e t e c t         =   f a l s e ;  
         }   / /   e n d   3  
  
         / /   4 .   D e f i n e s   t h e   n e w   c o l o r  
         / /   4 . 1   C u r r e n t   c o l o r   i s   t h e   d e f a u l t   o n e  
         i f   ( c u r r e n t C o l o r   = =   ' '  
                 | |   c u r r e n t C o l o r . t o L o w e r C a s e ( )   = =   t h e D e f a u l t C o l o r . t o L o w e r C a s e ( ) )   {  
                 i f   ( t h e A c t i o n   = =   ' o v e r '   & &   t h e P o i n t e r C o l o r   ! =   ' ' )   {  
                         n e w C o l o r                             =   t h e P o i n t e r C o l o r ;  
                 }  
                 e l s e   i f   ( t h e A c t i o n   = =   ' c l i c k '   & &   t h e M a r k C o l o r   ! =   ' ' )   {  
                         n e w C o l o r                             =   t h e M a r k C o l o r ;  
                         m a r k e d _ r o w [ t h e R o w N u m ]   =   t r u e ;  
                 }  
         }  
         / /   4 . 1 . 2   C u r r e n t   c o l o r   i s   t h e   p o i n t e r   o n e  
         e l s e   i f   ( c u r r e n t C o l o r . t o L o w e r C a s e ( )   = =   t h e P o i n t e r C o l o r . t o L o w e r C a s e ( )  
                           & &   ( t y p e o f ( m a r k e d _ r o w [ t h e R o w N u m ] )   = =   ' u n d e f i n e d '   | |   ! m a r k e d _ r o w [ t h e R o w N u m ] ) )   {  
                 i f   ( t h e A c t i o n   = =   ' o u t ' )   {  
                         n e w C o l o r                             =   t h e D e f a u l t C o l o r ;  
                 }  
                 e l s e   i f   ( t h e A c t i o n   = =   ' c l i c k '   & &   t h e M a r k C o l o r   ! =   ' ' )   {  
                         n e w C o l o r                             =   t h e M a r k C o l o r ;  
                         m a r k e d _ r o w [ t h e R o w N u m ]   =   t r u e ;  
                 }  
         }  
         / /   4 . 1 . 3   C u r r e n t   c o l o r   i s   t h e   m a r k e r   o n e  
         e l s e   i f   ( c u r r e n t C o l o r . t o L o w e r C a s e ( )   = =   t h e M a r k C o l o r . t o L o w e r C a s e ( ) )   {  
                 i f   ( t h e A c t i o n   = =   ' c l i c k ' )   {  
                         n e w C o l o r                             =   ( t h e P o i n t e r C o l o r   ! =   ' ' )  
                                                                     ?   t h e P o i n t e r C o l o r  
                                                                     :   t h e D e f a u l t C o l o r ;  
                         m a r k e d _ r o w [ t h e R o w N u m ]   =   ( t y p e o f ( m a r k e d _ r o w [ t h e R o w N u m ] )   = =   ' u n d e f i n e d '   | |   ! m a r k e d _ r o w [ t h e R o w N u m ] )  
                                                                     ?   t r u e  
                                                                     :   n u l l ;  
                 }  
         }   / /   e n d   4  
  
         / /   5 .   S e t s   t h e   n e w   c o l o r . . .  
         i f   ( n e w C o l o r )   {  
                 v a r   c   =   n u l l ;  
                 / /   5 . 1   . . .   w i t h   D O M   c o m p a t i b l e   b r o w s e r s   e x c e p t   O p e r a  
                 i f   ( d o m D e t e c t )   {  
                         f o r   ( c   =   0 ;   c   <   r o w C e l l s C n t ;   c + + )   {  
                                 t h e C e l l s [ c ] . s e t A t t r i b u t e ( ' b g c o l o r ' ,   n e w C o l o r ,   0 ) ;  
                         }   / /   e n d   f o r  
                 }  
                 / /   5 . 2   . . .   w i t h   o t h e r   b r o w s e r s  
                 e l s e   {  
                         f o r   ( c   =   0 ;   c   <   r o w C e l l s C n t ;   c + + )   {  
                                 t h e C e l l s [ c ] . s t y l e . b a c k g r o u n d C o l o r   =   n e w C o l o r ;  
                         }  
                 }  
         }   / /   e n d   5  
  
         r e t u r n   t r u e ;  
 }   / /   e n d   o f   t h e   ' s e t P o i n t e r ( ) '   f u n c t i o n  
  
 
