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