ÿþf u n c t i o n   m a s t e r F o c u s ( e ) {  
               i f   ( ! e ) e = e v e n t ; / / f o r   I E  
                   v a r   k e y C o d e   =   e . k e y C o d e   ?   e . k e y C o d e   :   e . w h i c h   ?   e . w h i c h   :   e . c h a r C o d e ;  
 	             i f   ( k e y C o d e   = =   1 3 )   {  
 	 	                     i f   ( c u r F o c u s   & &   c u r F o c u s . i d = = ' t x t S e a r c h ' ) {  
 	 	                         g o S e a r c h ( ) 	 	                          
 	 	                     } e l s e {  
                                
                         }  
                 }  
         }  
  
 / / c o m m e n t s  
 f u n c t i o n   s e n d C o m m e n t ( i d ) {  
   n e w   A j a x . R e q u e s t ( ' U s e r A c t i o n s . a s p x ? a c t i o n N a m e = a d d c o m m e n t & a r t i c l e i d = ' + i d ,  
   { p a r a m e t e r s : ' t x t N a m e = ' + e n c o d e U R I C o m p o n e n t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' t x t N a m e ' ) . v a l u e ) +  
   ' & t x t B o d y = ' + e n c o d e U R I C o m p o n e n t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' t x t B o d y ' ) . v a l u e ) +  
   ' & t x t S u b j e c t = ' + e n c o d e U R I C o m p o n e n t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' t x t S u b j e c t ' ) . v a l u e ) , o n S u c c e s s : f u n c t i o n ( t ) { / / a d d   c o m m e n t   o k ?  
     n e w   A j a x . R e q u e s t ( ' C o m m e n t s W r a p p e r . a s p x ? a r t i c l e i d = ' + i d , { m e t h o d : ' g e t ' , o n S u c c e s s : f u n c t i o n ( t ) { / / r e l o a d   t h e   c o m m e n t s   s e c t i o n  
 	 	 	                   i f   ( t . r e s p o n s e T e x t . i n d e x O f ( ' e r r o r ' ) ! = 0 ) {  
 	 	 	                     d o c u m e n t . g e t E l e m e n t B y I d ( ' c o m m e n t s ' ) . i n n e r H T M L = t . r e s p o n s e T e x t ;  
 	 	 	                   }  
 	 	 	                 } } ) ;  
   } } ) ;  
 }  
 f u n c t i o n   t o g g l e C o m m e n t s ( s h o w ) {  
   i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' c o m m e n t s _ f i e l d s ' ) . s t y l e . d i s p l a y = = ' n o n e ' ) {  
     d o c u m e n t . g e t E l e m e n t B y I d ( ' c o m m e n t s _ f i e l d s ' ) . s t y l e . d i s p l a y = ' b l o c k ' ;  
     d o c u m e n t . g e t E l e m e n t B y I d ( ' a _ t o g g l e C o m ' ) . i n n e r H T M L = ' áÒÙèÔ' ;  
   } e l s e {  
     d o c u m e n t . g e t E l e m e n t B y I d ( ' c o m m e n t s _ f i e l d s ' ) . s t y l e . d i s p l a y = ' n o n e ' ;  
     d o c u m e n t . g e t E l e m e n t B y I d ( ' a _ t o g g l e C o m ' ) . i n n e r H T M L = ' ÔÕáäê  êÒÕÑÔ' ;  
   }  
    
 }  
 f u n c t i o n   e n d C 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 ( ' t x t B o d y ' ) . v a l u e + = ' [ e c 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 ( ' t x t B o d y ' ) . s t y l e . d i r e c t i o n = ' r t l ' ;  
 	         d o c u m e n t . g e t E l e m e n t B y I d ( ' t x t B o d y ' ) . f o c u s ( ) ;  
 	 }  
 f u n c t i o n   s t a r t C 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 ( ' t x t B o d y ' ) . v a l u e + = ' [ s c 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 ( ' t x t B o d y ' ) . s t y l e . d i r e c t i o n = ' l t r ' ;  
 	         d o c u m e n t . g e t E l e m e n t B y I d ( ' t x t B o d y ' ) . f o c u s ( ) ;  
 	 }  
   f u n c t i o n   a d d C o d e ( c 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 ( ' t x t B o d y ' ) . v a l u e + = c 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 ( ' t x t B o d y ' ) . f o c u s ( ) ;  
 	 }  
 	 / / / / / / / / / / /  
  
  
   f u n c t i o n   g o S e a r c h ( ) {  
 	                 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' t x t S e a r c h ' ) . v a l u e = = ' ' ) {  
 	                         d o c u m e n t . g e t E l e m e n t B y I d ( ' s e a r c h _ v a l i d a t o r ' ) . s t y l e . v i s i b i l i t y = ' v i s i b l e ' ;  
 	                         r e t u r n ;  
 	                 } e l s e {  
 	                         v a r   t = ( d o c u m e n t . g e t E l e m e n t B y I d ( ' b y s u b j e c t s ' ) . c h e c k e d ? ' s ' : ' t ' ) ;  
 	                         w i n d o w . l o c a t i o n . h r e f = ' S e a r c h . a s p x ? q = ' + e n c o d e U R I C o m p o n e n t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' t x t S e a r c h ' ) . v a l u e ) + ' & t = ' + t ;  
 	                          
 	                 }  
 	                  
 	         }  
 	         f u n c t i o n   s e t S e a r c h ( s r c ) {  
 	                 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' b y s u b j e c t s ' ) . c h e c k e d ) {  
 	                         a j a x _ s h o w O p t i o n s ( s r c , ' 0 ' , e v e n t ) ;  
 	                 } e l s e {  
 	                         a j a x _ s h o w O p t i o n s ( s r c , ' 1 ' , e v e n t ) ;  
 	                 }  
 	                  
 	         }  
 	 	 	 f u n c t i o n   d o L o g ( s t r ) {  
 	 	 	 / / 	 v a r   l o g   =   d o c u m e n t . g e t E l e m e n t B y I d ( " l o g a r e a " ) ;  
 	 	 	 / / 	 l o g . i n n e r H T M L   =   l o g . i n n e r H T M L + s t r + " < / b r > "  
 	 	 	 / / 	 l o g . s c r o l l T o p   =   l o g . s c r o l l H e i g h t ;  
 	 	 	 }  
 	 	 	  
 	 	 	 v a r   u s e A j a x B r o w s e r = f a l s e ;  
 	 	 	 v a r   u r l = d o c u m e n t . U R L . s u b s t r i n g ( 0 , d o c u m e n t . U R L . l a s t I n d e x O f ( ' / ' , d o c u m e n t . U R L . l e n g t h - 1 ) ) ;  
 	 	 	 f u n c t i o n   t o n c l i c k ( i d ) {  
 	 	 	         v a r   p o s t   =   t r e e . g e t U s e r D a t a ( i d , ' l i n k ' ) ;  
 	 	 	         i f   ( p o s t ! = n u l l   & &   p o s t ! = ' ' ) {  
 	 	 	           i f   ( u s e A j a x B r o w s e r ) {  
 	 	 	                 n e w   A j a x . R e q u e s t ( p o s t + " . h t m l " , { m e t h o d : ' g e t ' , o n S u c c e s s : f u n c t i o n ( t ) {  
 	 	 	                         d o c u m e n t . g e t E l e m e n t B y I d ( ' c o n t e n t _ t o p ' ) . i n n e r H T M L = t . r e s p o n s e T e x t ;  
 	 	 	                         d o c u m e n t . g e t E l e m e n t B y I d ( ' l i n k t o ' ) . i n n e r H T M L = ' < a   h r e f = " ' + u r l + ' / ' + p o s t + ' " > ' + ' çÙéÕè  ÜÛêÑÔ: '   + u r l + ' / ' +   p o s t + ' . a s p x   < / a > ' ;  
 	 	 	                 } } ) ;  
 	 	 	                 n e w   A j a x . R e q u e s t ( ' A j a x S e a r c h e r . a s p x ? t y p e = 2 & s u b = ' + e n c o d e U R I C o m p o n e n t ( t r e e . g e t I t e m T e x t ( i d ) ) , { o n S u c c e s s : f u n c t i o n ( 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 ( ' s i m _ t o p i c s ' ) . s t y l e . d i s p l a y = = ' n o n e ' ) {  
 	 	 	                         d o c u m e n t . g e t E l e m e n t B y I d ( ' s i m _ t o p i c s ' ) . s t y l e . d i s p l a y = ' b l o c k ' ;  
 	 	 	                     }  
 	 	 	                         d o c u m e n t . g e t E l e m e n t B y I d ( ' t a g s ' ) . i n n e r H T M L = t . r e s p o n s e T e x t ;  
 	 	 	                 } } ) ;  
 	 	 	                   n e w   A j a x . R e q u e s t ( ' U s e r E x p e r i e n c e . a s p x ? q = ' + e n c o d e U R I C o m p o n e n t ( p o s t ) , { m e t h o d : ' g e t ' , o n S u c c e s s : f u n c t i o n ( t ) {  
 	 	 	                          
 	 	 	                 } } ) ;  
 	 	 	                 n e w   A j a x . R e q u e s t ( ' C o m m e n t s W r a p p e r . a s p x ? p a t h = ' + e n c o d e U R I ( p o s t ) , { m e t h o d : ' g e t ' , o n S u c c e s s : f u n c t i o n ( t ) {  
 	 	 	                   i f   ( t . r e s p o n s e T e x t . i n d e x O f ( ' e r r o r ' ) ! = 0 ) {  
 	 	 	                   d o c u m e n t . g e t E l e m e n t B y I d ( ' c o m m e n t s W r a p p e r ' ) . s t y l e . d i s p l a y = ' b l o c k ' ;  
 	 	 	                     d o c u m e n t . g e t E l e m e n t B y I d ( ' c o m m e n t s ' ) . i n n e r H T M L = t . r e s p o n s e T e x t ;  
 	 	 	                   }  
 	 	 	                 } } ) ;  
 	 	 	                 w i n d o w . d o c u m e n t . t i t l e = p o s t ;  
 	 	 	             } e l s e {  
 	 	 	                 w i n d o w . l o c a t i o n . h r e f = p o s t + ' . a s p x ' ;  
 	 	 	             }  
 	 	 	 	 }  
 	 	 	 } ;  
 	 	 	 f u n c t i o n   t o n o p e n ( i d , m o d e ) {  
 	 	 	 	 / / r e t u r n   c o n f i r m ( " D o   y o u   w a n t   t o   " + ( m o d e > 0 ? " c l o s e " : " o p e n " ) + "   n o d e   " + t r e e . g e t I t e m T e x t ( i d ) + " ? " ) ;  
 	 	 	 } ;  
  
 / *  
 C o p y r i g h t   D H T M L X   L T D .   h t t p : / / w w w . d h t m l x . c o m  
 T o   u s e   t h i s   c o m p o n e n t   p l e a s e   c o n t a c t   s a l e s @ d h t m l x . c o m   t o   o b t a i n   l i c e n s e  
 * /  
  
 / * _ T O P I C S _  
 @ 0 : I n i t i a l i z a t i o n  
 @ 1 : S e l e c t i o n   c o n t r o l  
 @ 2 : A d d / d e l e t e  
 @ 3 : P r i v a t e  
 @ 4 : N o d e / l e v e l   c o n t r o l  
 @ 5 : C h e c k b o x e s / u s e r   d a t a   m a n i p u l a t i o n  
 @ 6 : A p p e a r e n c e   c o n t r o l  
 @ 7 :   H a n d l e r s  
 * /  
  
 f u n c t i o n   x m l P o i n t e r ( d a t a ) {  
 	 t h i s . d = d a t a ;  
 }  
 x m l P o i n t e r . p r o t o t y p e = {  
 	 t e x t : f u n c t i o n ( ) {   i f   ( ! _ i s F F )   r e t u r n   t h i s . d . x m l ;   v a r   x   =   n e w   X M L S e r i a l i z e r ( ) ;       r e t u r n   x . s e r i a l i z e T o S t r i n g ( t h i s . d ) ;   } ,  
 	 g e t : f u n c t i o n ( n a m e ) { r e t u r n   t h i s . d . g e t A t t r i b u t e ( n a m e ) ;   } ,  
 	 e x i s t s : f u n c t i o n ( ) { r e t u r n   ! ! t h i s . d   } ,  
 	 c o n t e n t : f u n c t i o n ( ) { r e t u r n   t h i s . d . f i r s t C h i l d ? t h i s . d . f i r s t C h i l d . d a t a : " " ;   } ,   / /   < 4 k   i n   F F  
 	 e a c h : f u n c t i o n ( n a m e , f , t , i ) {     v a r   a = t h i s . d . c h i l d N o d e s ;   v a r   c = n e w   x m l P o i n t e r ( ) ;   i f   ( a . l e n g t h )   f o r   ( i = i | | 0 ;   i < a . l e n g t h ;   i + + )   i f   ( a [ i ] . t a g N a m e = = n a m e )   {   c . d = a [ i ] ;   i f ( f . a p p l y ( t , [ c , i ] ) = = - 1 )   r e t u r n ;   }   } ,  
 	 g e t _ a l l : f u n c t i o n ( ) {   v a r   a = { } ;   v a r   b = t h i s . d . a t t r i b u t e s ;   f o r   ( v a r   i = 0 ;   i < b . l e n g t h ;   i + + )   a [ b [ i ] . n a m e ] = b [ i ] . v a l u e ;   r e t u r n   a ;   } ,  
 	 s u b : f u n c t i o n ( n a m e ) {   v a r   a = t h i s . d . c h i l d N o d e s ;   v a r   c = n e w   x m l P o i n t e r ( ) ;   i f   ( a . l e n g t h )   f o r   ( v a r   i = 0 ;   i < a . l e n g t h ;   i + + )   i f   ( a [ i ] . t a g N a m e = = n a m e )   {   c . d = a [ i ] ;   r e t u r n   c ;   }   } ,  
 	 u p : f u n c t i o n ( n a m e ) {   r e t u r n   n e w   x m l P o i n t e r ( t h i s . d . p a r e n t N o d e ) ;     } ,  
 	 s e t : f u n c t i o n ( n a m e , v a l ) {   t h i s . d . s e t A t t r i b u t e ( n a m e , v a l ) ;     } ,  
 	 c l o n e : f u n c t i o n ( n a m e ) {   r e t u r n   n e w   x m l P o i n t e r ( t h i s . d ) ;   } ,  
 	 s u b _ e x i s t s : f u n c t i o n ( n a m e ) {   v a r   a = t h i s . d . c h i l d N o d e s ;   i f   ( a . l e n g t h )   f o r   ( v a r   i = 0 ;   i < a . l e n g t h ;   i + + )   i f   ( a [ i ] . t a g N a m e = = n a m e )   r e t u r n   t r u e ;     r e t u r n   f a l s e ;     } ,  
 	 t h r o u g h : f u n c t i o n ( n a m e , r u l e , v , f , t ) {     v a r   a = t h i s . d . c h i l d N o d e s ;   i f   ( a . l e n g t h )   f o r   ( v a r   i = 0 ;   i < a . l e n g t h ;   i + + )   {   i f   ( a [ i ] . t a g N a m e = = n a m e   & &   a [ i ] . g e t A t t r i b u t e ( r u l e ) ! = n u l l   & &   a [ i ] . g e t A t t r i b u t e ( r u l e ) ! = " "   & &     ( ! v   | |   a [ i ] . g e t A t t r i b u t e ( r u l e ) = = v   ) )   {   v a r   c = n e w   x m l P o i n t e r ( a [ i ] ) ;     f . a p p l y ( t , [ c , i ] ) ;   }   v a r   w = t h i s . d ;   t h i s . d = a [ i ] ;   t h i s . t h r o u g h ( n a m e , r u l e , v , f , t ) ;   t h i s . d = w ;     }   }  
 }  
  
  
  
 / * *  
 *           @ d e s c :   t r e e   c o n s t r u c t o r  
 *           @ p a r a m :   h t m l O b j e c t   -   p a r e n t   h t m l   o b j e c t   o r   i d   o f   p a r e n t   h t m l   o b j e c t  
 *           @ p a r a m :   w i d t h   -   t r e e   w i d t h  
 *           @ p a r a m :   h e i g h t   -   t r e e   h e i g h t  
 *           @ p a r a m :   r o o t I d   -   i d   o f   v i r t u a l   r o o t   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0  
 * /  
 f u n c t i o n   d h t m l X T r e e O b j e c t ( h t m l O b j e c t ,   w i d t h ,   h e i g h t ,   r o o t I d ) {  
 	 i f   ( _ i s I E )   t r y   {   d o c u m e n t . e x e c C o m m a n d ( " B a c k g r o u n d I m a g e C a c h e " ,   f a l s e ,   t r u e ) ;   }   c a t c h   ( e ) { }  
 	 i f   ( t y p e o f ( h t m l O b j e c t ) ! = " o b j e c t " )  
             t h i s . p a r e n t O b j e c t = d o c u m e n t . g e t E l e m e n t B y I d ( h t m l O b j e c t ) ;  
 	 e l s e  
             t h i s . p a r e n t O b j e c t = h t m l O b j e c t ;  
  
       	 t h i s . _ i t i m _ d g = t r u e ;  
         t h i s . d l m t r = " , " ;  
         t h i s . d r o p L o w e r = f a l s e ;  
 	 t h i s . e n a b l e I E I m a g e F i x ( ) ;  
  
       t h i s . x m l s t a t e = 0 ;  
       t h i s . m y t y p e = " t r e e " ;  
       t h i s . s m c h e c k = t r u e ;       / / s m a r t   c h e c k b o x e s  
       t h i s . w i d t h = w i d t h ;  
       t h i s . h e i g h t = h e i g h t ;  
       t h i s . r o o t I d = r o o t I d ;  
       t h i s . c h i l d C a l c = n u l l ;  
             t h i s . d e f _ i m g _ x = " 1 8 p x " ;  
             t h i s . d e f _ i m g _ y = " 1 8 p x " ;  
             t h i s . d e f _ l i n e _ i m g _ x = " 1 8 p x " ;  
             t h i s . d e f _ l i n e _ i m g _ y = " 1 8 p x " ;  
  
         t h i s . _ d r a g g e d = n e w   A r r a y ( ) ;  
       t h i s . _ s e l e c t e d = n e w   A r r a y ( ) ;  
  
       t h i s . s t y l e _ p o i n t e r = " p o i n t e r " ;  
       i f   ( _ i s I E )     t h i s . s t y l e _ p o i n t e r = " h a n d " ;  
  
       t h i s . _ a i m g s = t r u e ;  
       t h i s . h t m l c A = "   [ " ;  
       t h i s . h t m l c B = " ] " ;  
       t h i s . l W i n = w i n d o w ;  
       t h i s . c M e n u = 0 ;  
       t h i s . m l i t e m s = 0 ;  
       t h i s . d a d m o d e = 0 ;  
       t h i s . s l o w P a r s e = f a l s e ;  
       t h i s . a u t o S c r o l l = t r u e ;  
       t h i s . h f M o d e = 0 ;  
       t h i s . n o d e C u t = n e w   A r r a y ( ) ;  
       t h i s . X M L s o u r c e = 0 ;  
       t h i s . X M L l o a d i n g W a r n i n g = 0 ;  
       t h i s . _ i d p u l l = { } ;  
       t h i s . _ p u l l S i z e = 0 ;  
       t h i s . t r e e L i n e s O n = t r u e ;  
       t h i s . t s c h e c k = f a l s e ;  
       t h i s . t i m g e n = t r u e ;  
       t h i s . d p c p y = f a l s e ;  
         t h i s . _ l d _ i d = n u l l ;  
 	 t h i s . _ o i e _ o n X L E = [ ] ;  
       t h i s . i m P a t h = " t r e e G f x / " ;  
       t h i s . c h e c k A r r a y = n e w   A r r a y ( " i c o n U n C h e c k A l l . g i f " , " i c o n C h e c k A l l . g i f " , " i c o n C h e c k G r a y . g i f " , " i c o n U n c h e c k D i s . g i f " , " i c o n C h e c k D i s . g i f " , " i c o n C h e c k D i s . g i f " ) ;  
       t h i s . r a d i o A r r a y = n e w   A r r a y ( " r a d i o _ o f f . g i f " , " r a d i o _ o n . g i f " , " r a d i o _ o n . g i f " , " r a d i o _ o f f . g i f " , " r a d i o _ o n . g i f " , " r a d i o _ o n . g i f " ) ;  
  
       t h i s . l i n e A r r a y = n e w   A r r a y ( " l i n e 2 . g i f " , " l i n e 3 . g i f " , " l i n e 4 . g i f " , " b l a n k . g i f " , " b l a n k . g i f " , " l i n e 1 . g i f " ) ;  
       t h i s . m i n u s A r r a y = n e w   A r r a y ( " m i n u s 2 . g i f " , " m i n u s 3 . g i f " , " m i n u s 4 . g i f " , " m i n u s . g i f " , " m i n u s 5 . g i f " ) ;  
       t h i s . p l u s A r r a y = n e w   A r r a y ( " p l u s 2 . g i f " , " p l u s 3 . g i f " , " p l u s 4 . g i f " , " p l u s . g i f " , " p l u s 5 . g i f " ) ;  
       t h i s . i m a g e A r r a y = n e w   A r r a y ( " l e a f . g i f " , " f o l d e r O p e n . g i f " , " f o l d e r C l o s e d . g i f " ) ;  
       t h i s . c u t I m g =   n e w   A r r a y ( 0 , 0 , 0 ) ;  
       t h i s . c u t I m a g e = " b u t _ c u t . g i f " ;  
  
       t h i s . d r a g g e r =   n e w   d h t m l D r a g A n d D r o p O b j e c t ( ) ;  
 / / c r e a t e   r o o t  
       t h i s . h t m l N o d e = n e w   d h t m l X T r e e I t e m O b j e c t ( t h i s . r o o t I d , " " , 0 , t h i s ) ;  
       t h i s . h t m l N o d e . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . s t y l e . d i s p l a y = " n o n e " ;  
       t h i s . h t m l N o d e . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c l a s s N a m e = " h i d d e n R o w " ;  
 / / i n i t   t r e e   s t r u c t u r e s  
       t h i s . a l l T r e e = t h i s . _ c r e a t e S e l f ( ) ;  
       t h i s . a l l T r e e . a p p e n d C h i l d ( t h i s . h t m l N o d e . h t m l N o d e ) ;  
         i f ( _ i s F F )   t h i s . a l l T r e e . c h i l d N o d e s [ 0 ] . w i d t h = " 1 0 0 % " ;  
  
       v a r   s e l f = t h i s ;  
       t h i s . a l l T r e e . o n s e l e c t s t a r t = n e w   F u n c t i o n ( " r e t u r n   f a l s e ; " ) ;  
       i f   ( _ i s M a c O S )  
 	 	 t h i s . a l l T r e e . o n c o n t e x t m e n u   =   f u n c t i o n ( e ) {   r e t u r n   s e l f . _ d o C o n t C l i c k ( e | | w i n d o w . e v e n t ) ;   } ;        
       t h i s . a l l T r e e . o n m o u s e d o w n   =   f u n c t i o n ( e ) {   r e t u r n   s e l f . _ d o C o n t C l i c k ( e | | w i n d o w . e v e n t ) ;   } ;      
        
       t h i s . X M L L o a d e r = n e w   d t m l X M L L o a d e r O b j e c t ( t h i s . _ p a r s e X M L T r e e , t h i s , t r u e , t h i s . n o _ c a s h e ) ;  
       i f   ( _ i s I E )   t h i s . p r e v e n t I E C a s h i n g ( t r u e ) ;  
  
 
  
          
         i f   ( w i n d o w . a d d E v e n t L i s t e n e r )   w i n d o w . a d d E v e n t L i s t e n e r ( " u n l o a d " , f u n c t i o n ( ) { t r y {     s e l f . d e s t r u c t o r ( ) ;   }   c a t c h ( e ) { } } , f a l s e ) ;  
         i f   ( w i n d o w . a t t a c h E v e n t )   w i n d o w . a t t a c h E v e n t ( " o n u n l o a d " , f u n c t i o n ( ) {   t r y {   s e l f . d e s t r u c t o r ( ) ;   }   c a t c h ( e ) { } } ) ;  
  
 	 t h i s . d h x _ E v e n t ( ) ;  
 	 t h i s . _ o n E v e n t S e t = { o n M o u s e I n : f u n c t i o n ( ) { t h i s . e h l t = t r u e ; } , o n M o u s e O u t : f u n c t i o n ( ) { t h i s . e h l t = t r u e ; } , o n S e l e c t : f u n c t i o n ( ) { t h i s . _ o n S S C F = t r u e ; } }  
  
       r e t u r n   t h i s ;  
 } ;  
  
  
 / * *  
 *           @ d e s c :   s e t   d e f a u l t   d a t a   t r a n s f e r   m o d e    
 *           @ p a r a m :   m o d e   -   d a t a   m o d e   ( j s o n , x m l , c s v )  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t D a t a M o d e = f u n c t i o n ( m o d e ) {  
 	 	 t h i s . _ d a t a m o d e = m o d e ;  
 }  
  
  
 	  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ d o C o n t C l i c k = f u n c t i o n ( e v ) {  
 	 i f   ( e v . b u t t o n ! = 2 )   {  
 	 	 	         i f ( t h i s . _ a c M e n u )   t h i s . c M e n u . _ c o n t e x t E n d ( ) ;  
 	 	 	         r e t u r n   t r u e ;  
 	 	 	 }  
 	  
 	 v a r   e l = ( _ i s I E ? e v . s r c E l e m e n t : e v . t a r g e t ) ;  
 	 w h i l e   ( ( e l ) & & ( e l . t a g N a m e ! = " B O D Y " ) )   {  
 	 	 i f   ( e l . p a r e n t O b j e c t )   b r e a k ;  
         	   e l = e l . p a r e n t N o d e ;  
 	   }  
         	  
         i f   ( ( ! e l ) | | ( ! e l . p a r e n t O b j e c t ) )   r e t u r n   t r u e ;  
          
         v a r   o b j = e l . p a r e n t O b j e c t ;  
         	 t h i s . _ a c M e n u = ( o b j . c M e n u | | t h i s . c M e n u ) ;  
                 i f   ( t h i s . _ a c M e n u ) {  
                       e l . c o n t e x t M e n u I d = o b j . i d ;  
                       e l . c o n t e x t M e n u = t h i s . _ a c M e n u ;  
                       e l . a = t h i s . _ a c M e n u . _ c o n t e x t S t a r t ;  
                       i f   ( _ i s I E )  
                               e v . s r c E l e m e n t . o n c o n t e x t m e n u   =   f u n c t i o n ( ) {   e v e n t . c a n c e l B u b b l e = t r u e ;   r e t u r n   f a l s e ;   } ;  
                       e l . a ( e l , e v ) ;   e l . a = n u l l ;  
 	 	 	 e v . c a n c e l B u b b l e = t r u e ;  
 	 	 	 r e t u r n   f a l s e ;                        
         	 }  
         r e t u r n   t r u e ;  
 }  
  
  
 / * *  
 *           @ d e s c :   r e p l a c e   I M G   t a g   w i t h   b a c k g r o u n d   i m a g e s   -   s o l v e   p r o b l e m   w i t h   I E   i m a g e   c a c h i n g   ,   n o t   w o r k s   f o r   I E 6   S P 1  
 *           @ p a r a m :   m o d e   -   t r u e / f a l s e   -   e n a b l e / d i s a b l e   f i x  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e I E I m a g e F i x = f u n c t i o n ( m o d e ) {  
 	 i f   ( ! m o d e ) {  
  
 	 t h i s . _ g e t I m g = f u n c t i o n ( i d ) {   r e t u r n   d o c u m e n t . c r e a t e E l e m e n t ( ( i d = = t h i s . r o o t I d ) ? " d i v " : " i m g " ) ;   }  
 	 t h i s . _ s e t S r c = f u n c t i o n ( a , b ) {   a . s r c = b ;   }  
 	 t h i s . _ g e t S r c = f u n c t i o n ( a ) {   r e t u r n   a . s r c ;   }  
 	 } 	 e l s e 	 {  
  
 	 t h i s . _ g e t I m g = f u n c t i o n ( ) {   v a r   z = d o c u m e n t . c r e a t e E l e m e n t ( " D I V " ) ;   z . i n n e r H T M L = " & n b s p ; " ;   z . c l a s s N a m e = " d h x _ b g _ i m g _ f i x " ;   r e t u r n   z ;   }  
 	 t h i s . _ s e t S r c = f u n c t i o n ( a , b ) {   a . s t y l e . b a c k g r o u n d I m a g e = " u r l ( " + b + " ) " ;   }  
 	 t h i s . _ g e t S r c = f u n c t i o n ( a ) {   v a r   z = a . s t y l e . b a c k g r o u n d I m a g e ;     r e t u r n   z . s u b s t r ( 4 , z . l e n g t h - 5 ) ;   }  
 	 }  
 }  
  
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . d e s t r u c t o r = f u n c t i o n ( ) {  
         f o r   ( v a r   a   i n   t h i s . _ i d p u l l ) {  
                 v a r   z = t h i s . _ i d p u l l [ a ] ;  
 	 	 i f   ( ! z )   c o n t i n u e ;  
                 z . p a r e n t O b j e c t = n u l l ; z . t r e e N o d = n u l l ; z . c h i l d N o d e s = n u l l ; z . s p a n = n u l l ; z . t r . n o d e m = n u l l ; z . t r = n u l l ; z . h t m l N o d e . o b j B e l o n g = n u l l ; z . h t m l N o d e = n u l l ;  
                 t h i s . _ i d p u l l [ a ] = n u l l ;  
                 }  
         t h i s . a l l T r e e . i n n e r H T M L = " " ;  
         t h i s . X M L L o a d e r . d e s t r u c t o r ( ) ;  
         f o r ( v a r   a   i n   t h i s ) {  
                 t h i s [ a ] = n u l l ;  
                 }  
 }  
  
 f u n c t i o n   c O b j e c t ( ) {  
         r e t u r n   t h i s ;  
 }  
 c O b j e c t . p r o t o t y p e =   n e w   O b j e c t ;  
 c O b j e c t . p r o t o t y p e . c l o n e   =   f u n c t i o n   ( )   {  
               f u n c t i o n   _ d u m m y ( ) { } ;  
               _ d u m m y . p r o t o t y p e = t h i s ;  
               r e t u r n   n e w   _ d u m m y ( ) ;  
         }  
  
 / * *  
 *       @ d e s c :   t r e e   n o d e   c o n s t r u c t o r  
 *       @ p a r a m :   i t e m I d   -   n o d e   i d  
 *       @ p a r a m :   i t e m T e x t   -   n o d e   l a b e l  
 *       @ p a r a m :   p a r e n t O b j e c t   -   p a r e n t   i t e m   o b j e c t  
 *       @ p a r a m :   t r e e O b j e c t   -   t r e e   o b j e c t  
 *       @ p a r a m :   a c t i o n H a n d l e r   -   o n c l i c k   e v e n t   h a n d l e r ( o p t i o n a l )  
 *       @ p a r a m :   m o d e   -   d o   n o t   s h o w   i m a g e s  
 *       @ t y p e :   p r i v a t e  
 *       @ t o p i c :   0  
 * /  
 f u n c t i o n   d h t m l X T r e e I t e m O b j e c t ( i t e m I d , i t e m T e x t , p a r e n t O b j e c t , t r e e O b j e c t , a c t i o n H a n d l e r , m o d e ) {  
       t h i s . h t m l N o d e = " " ;  
       t h i s . a c o l o r = " " ;  
       t h i s . s c o l o r = " " ;  
       t h i s . t r = 0 ;  
       t h i s . c h i l d s C o u n t = 0 ;  
       t h i s . t e m p D O M M = 0 ;  
       t h i s . t e m p D O M U = 0 ;  
       t h i s . d r a g S p a n = 0 ;  
       t h i s . d r a g M o v e = 0 ;  
       t h i s . s p a n = 0 ;  
       t h i s . c l o s e b l e = 1 ;  
       t h i s . c h i l d N o d e s = n e w   A r r a y ( ) ;  
       t h i s . u s e r D a t a = n e w   c O b j e c t ( ) ;  
  
  
       t h i s . c h e c k s t a t e = 0 ;  
       t h i s . t r e e N o d = t r e e O b j e c t ;  
       t h i s . l a b e l = i t e m T e x t ;  
       t h i s . p a r e n t O b j e c t = p a r e n t O b j e c t ;  
       t h i s . a c t i o n H a n d l e r = a c t i o n H a n d l e r ;  
       t h i s . i m a g e s = n e w   A r r a y ( t r e e O b j e c t . i m a g e A r r a y [ 0 ] , t r e e O b j e c t . i m a g e A r r a y [ 1 ] , t r e e O b j e c t . i m a g e A r r a y [ 2 ] ) ;  
  
  
       t h i s . i d = t r e e O b j e c t . _ g l o b a l I d S t o r a g e A d d ( i t e m I d , t h i s ) ;  
       i f   ( t h i s . t r e e N o d . c h e c k B o x O f f   )   t h i s . h t m l N o d e = t h i s . t r e e N o d . _ c r e a t e I t e m ( 1 , t h i s , m o d e ) ;  
       e l s e     t h i s . h t m l N o d e = t h i s . t r e e N o d . _ c r e a t e I t e m ( 0 , t h i s , m o d e ) ;  
  
       t h i s . h t m l N o d e . o b j B e l o n g = t h i s ;  
       r e t u r n   t h i s ;  
       } ;        
  
  
 / * *  
 *           @ d e s c :   r e g i s t e r   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ p a r a m :   i t e m O b j e c t   -   n o d e   o b j e c t  
 *           @ t o p i c :   3      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g l o b a l I d S t o r a g e A d d = f u n c t i o n ( i t e m I d , i t e m O b j e c t ) {  
             i f   ( t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d , 1 , 1 ) )   {       i t e m I d = i t e m I d   + " _ " + ( n e w   D a t e ( ) ) . v a l u e O f ( ) ;   r e t u r n   t h i s . _ g l o b a l I d S t o r a g e A d d ( i t e m I d , i t e m O b j e c t ) ;   }  
 	     	   t h i s . _ i d p u l l [ i t e m I d ] = i t e m O b j e c t ;  
                   t h i s . _ p u l l S i z e + + ;  
             r e t u r n   i t e m I d ;  
       } ;  
  
 / * *  
 *           @ d e s c :   u n r e g i s t e r   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ t o p i c :   3  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g l o b a l I d S t o r a g e S u b = f u n c t i o n ( i t e m I d ) {  
                 i f   ( t h i s . _ i d p u l l [ i t e m I d ] ) {  
 	 	         t h i s . _ u n s e l e c t I t e m ( t h i s . _ i d p u l l [ i t e m I d ] ) ;  
 	 	 	 t h i s . _ i d p u l l [ i t e m I d ] = n u l l ;  
 	 	 	 t h i s . _ p u l l S i z e - - ;  
                 }  
 	 	 i f   ( ( t h i s . _ l o c k e r ) & & ( t h i s . _ l o c k e r [ i t e m I d ] ) )   t h i s . _ l o c k e r [ i t e m I d ] = f a l s e ;  
       } ;  
        
 / * *  
 *           @ d e s c :   r e t u r n   n o d e   o b j e c t  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   3  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g l o b a l I d S t o r a g e F i n d = f u n c t i o n ( i t e m I d , s k i p X M L S e a r c h , s k i p P a r s i n g , i s r e p a r s e ) {  
 	 	 v a r   z = t h i s . _ i d p u l l [ i t e m I d ]  
                 i f   ( z ) {  
 
                         r e t u r n   z ;  
                         }  
 
 	     	 r e t u r n   n u l l ;  
       } ;  
 
  
 / * *  
 *           @ d e s c :   e s c a p e   s t r i n g  
 *           @ p a r a m :   i t e m I d   -   i t e m   I D  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   3  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ e s c a p e = f u n c t i o n ( s t r ) {  
                 s w i t c h ( t h i s . u t f e s c ) {  
                 c a s e   " n o n e " :  
                         r e t u r n   s t r ;  
                         b r e a k ;  
                 c a s e   " u t f 8 " :  
                   r e t u r n   e n c o d e U R I ( s t r ) ;  
                         b r e a k ;  
                 d e f a u l t :  
                   r e t u r n   e s c a p e ( s t r ) ;  
                         b r e a k ;  
                 }  
       }  
  
  
  
 / * *  
 *           @ d e s c :   c r e a t e   a n d   r e t u r n     n e w   l i n e   i n   t r e e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   h t m l O b j e c t   -   p a r e n t   N o d e   o b j e c t  
 *           @ p a r a m :   n o d e   -   i t e m   o b j e c t  
 *           @ t o p i c :   2      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ d r a w N e w T r = f u n c t i o n ( h t m l O b j e c t , n o d e )  
       {  
             v a r   t r   = d o c u m e n t . c r e a t e E l e m e n t ( ' t r ' ) ;  
             v a r   t d 1 = d o c u m e n t . c r e a t e E l e m e n t ( ' t d ' ) ;  
             v a r   t d 2 = d o c u m e n t . c r e a t e E l e m e n t ( ' t d ' ) ;  
             t d 1 . a p p e n d C h i l d ( d o c u m e n t . c r e a t e T e x t N o d e ( "   " ) ) ;  
               t d 2 . c o l S p a n = 3 ;  
             t d 2 . a p p e n d C h i l d ( h t m l O b j e c t ) ;  
             t r . a p p e n d C h i l d ( t d 1 ) ;     t r . a p p e n d C h i l d ( t d 2 ) ;  
             r e t u r n   t r ;  
       } ;  
 / * *  
 *           @ d e s c :   l o a d   t r e e   f r o m   x m l   s t r i n g  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   x m l S t r i n g   -   X M L   s t r i n g  
 *           @ p a r a m :   a f t e r C a l l   -   f u n c t i o n   w h i c h   w i l l   b e   c a l l e d   a f t e r   x m l   l o a d i n g  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . l o a d X M L S t r i n g = f u n c t i o n ( x m l S t r i n g , a f t e r C a l l ) {  
                 v a r   t h a t = t h i s ;  
             i f   ( ! t h i s . p a r s C o u n t )   t h i s . c a l l E v e n t ( " o n X L S " , [ t h a t , n u l l ] ) ;  
             t h i s . x m l s t a t e = 1 ;  
  
                 i f   ( a f t e r C a l l )   t h i s . X M L L o a d e r . w a i t C a l l = a f t e r C a l l ;  
             t h i s . X M L L o a d e r . l o a d X M L S t r i n g ( x m l S t r i n g ) ;     } ;  
 / * *  
 *           @ d e s c :   l o a d   t r e e   f r o m   x m l   f i l e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   f i l e   -   l i n k   t o   X M L   f i l e  
 *           @ p a r a m :   a f t e r C a l l   -   f u n c t i o n   w h i c h   w i l l   b e   c a l l e d   a f t e r   x m l   l o a d i n g  
 *           @ t o p i c :   0  
 * /  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . l o a d X M L = f u n c t i o n ( f i l e , a f t e r C a l l ) {    
 	     i f   ( t h i s . _ d a t a m o d e   & &   t h i s . _ d a t a m o d e ! = " x m l " )   r e t u r n   t h i s [ " l o a d " + t h i s . _ d a t a m o d e . t o U p p e r C a s e ( ) ] ( f i l e , a f t e r C a l l ) ;  
                 v a r   t h a t = t h i s ;  
             i f   ( ! t h i s . p a r s C o u n t )   t h i s . c a l l E v e n t ( " o n X L S " , [ t h a t , t h i s . _ l d _ i d ] ) ;  
             t h i s . _ l d _ i d = n u l l ;  
             t h i s . x m l s t a t e = 1 ;  
             t h i s . X M L L o a d e r = n e w   d t m l X M L L o a d e r O b j e c t ( t h i s . _ p a r s e X M L T r e e , t h i s , t r u e , t h i s . n o _ c a s h e ) ;  
             i f   ( a f t e r C a l l )   t h i s . X M L L o a d e r . w a i t C a l l = a f t e r C a l l ;  
             t h i s . X M L L o a d e r . l o a d X M L ( f i l e ) ;            
       } ;  
 / * *  
 *           @ d e s c :   c r e a t e   n e w   c h i l d   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   p a r e n t O b j e c t   -   p a r e n t   n o d e   o b j e c t  
 *           @ p a r a m :   i t e m I d   -   n e w   n o d e   i d  
 *           @ p a r a m :   i t e m T e x t   -   n e w   n o d e   t e x t  
 *           @ p a r a m :   i t e m A c t i o n H a n d l e r   -   f u n c t i o n   f i r e d   o n   n o d e   s e l e c t   e v e n t  
 *           @ p a r a m :   i m a g e 1   -   i m a g e   f o r   n o d e   w i t h o u t   c h i l d r e n s ;  
 *           @ p a r a m :   i m a g e 2   -   i m a g e   f o r   c l o s e d   n o d e ;  
 *           @ p a r a m :   i m a g e 3   -   i m a g e   f o r   o p e n e d   n o d e  
 *           @ p a r a m :   o p t i o n S t r   -   s t r i n g   o f   o t i o n s  
 *           @ p a r a m :   c h i l d s   -   n o d e   c h i l d s   f l a g   ( f o r   d y n a m i c a l   t r e e s )   ( o p t i o n a l )  
 *           @ p a r a m :   b e f o r e N o d e   -   n o d e ,   a f t e r   w h i c h   n e w   n o d e   w i l l   b e   i n s e r t e d   ( o p t i o n a l )  
 *           @ t o p i c :   2  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ a t t a c h C h i l d N o d e = f u n c t i o n ( p a r e n t O b j e c t , i t e m I d , i t e m T e x t , i t e m A c t i o n H a n d l e r , i m a g e 1 , i m a g e 2 , i m a g e 3 , o p t i o n S t r , c h i l d s , b e f o r e N o d e , a f t e r N o d e ) {  
  
                   i f   ( b e f o r e N o d e   & &   b e f o r e N o d e . p a r e n t O b j e c t )   p a r e n t O b j e c t = b e f o r e N o d e . p a r e n t O b j e c t ;  
                   i f   ( ( ( p a r e n t O b j e c t . X M L l o a d = = 0 ) & & ( t h i s . X M L s o u r c e ) ) & & ( ! t h i s . X M L l o a d i n g W a r n i n g ) )  
                   {  
                         p a r e n t O b j e c t . X M L l o a d = 1 ;  
                                 t h i s . _ l o a d D y n X M L ( p a r e n t O b j e c t . i d ) ;  
  
                   }  
  
                   v a r   C o u n t = p a r e n t O b j e c t . c h i l d s C o u n t ;  
                   v a r   N o d e s = p a r e n t O b j e c t . c h i l d N o d e s ;  
  
  
                         i f   ( a f t e r N o d e ) {  
                         i f   ( a f t e r N o d e . t r . p r e v i o u s S i b l i n g . p r e v i o u s S i b l i n g ) {  
                               b e f o r e N o d e = a f t e r N o d e . t r . p r e v i o u s S i b l i n g . n o d e m ;  
                               }  
                         e l s e  
                               o p t i o n S t r = o p t i o n S t r . r e p l a c e ( " T O P " , " " ) + " , T O P " ;  
                               }  
  
                   i f   ( b e f o r e N o d e )  
                         {  
                         v a r   i k , j k ;  
                         f o r   ( i k = 0 ;   i k < C o u n t ;   i k + + )  
                               i f   ( N o d e s [ i k ] = = b e f o r e N o d e )  
                               {  
                               f o r   ( j k = C o u n t ;   j k ! = i k ;   j k - - )  
                                     N o d e s [ 1 + j k ] = N o d e s [ j k ] ;  
                               b r e a k ;  
                               }  
                         i k + + ;  
                         C o u n t = i k ;  
                         }  
  
  
                   i f   ( o p t i o n S t r )   {  
                           v a r   t e m p S t r = o p t i o n S t r . s p l i t ( " , " ) ;  
                         f o r   ( v a r   i = 0 ;   i < t e m p S t r . l e n g t h ;   i + + )  
                         {  
                               s w i t c h ( t e m p S t r [ i ] )  
                               {  
                                     c a s e   " T O P " :   i f   ( p a r e n t O b j e c t . c h i l d s C o u n t > 0 )   {   b e f o r e N o d e = n e w   O b j e c t ;   b e f o r e N o d e . t r = p a r e n t O b j e c t . c h i l d N o d e s [ 0 ] . t r . p r e v i o u s S i b l i n g ;   }  
 	 	 	 	     	   p a r e n t O b j e c t . _ h a s _ t o p = t r u e ;  
                                           f o r     ( i k = C o u n t ;   i k > 0 ;   i k - - )  
                                                 N o d e s [ i k ] = N o d e s [ i k - 1 ] ;  
                                                 C o u n t = 0 ;  
                                           b r e a k ;  
                               }  
                         } ;  
                     } ;  
  
                 	 v a r   n ;  
 	 	 i f   ( ! ( n = t h i s . _ i d p u l l [ i t e m I d ] )   | |   n . s p a n ! = - 1 ) {  
                   	 n = N o d e s [ C o u n t ] = n e w   d h t m l X T r e e I t e m O b j e c t ( i t e m I d , i t e m T e x t , p a r e n t O b j e c t , t h i s , n u l l , 1 ) ;  
                   	 i t e m I d   =   N o d e s [ C o u n t ] . i d ;  
                   	 p a r e n t O b j e c t . c h i l d s C o u n t + + ;  
           	 }  
                 e l s e   {  
                       n . l a b e l = i t e m T e x t ;  
 	 	       n . h t m l N o d e = t h i s . _ c r e a t e I t e m ( ( t h i s . c h e c k B o x O f f ? 1 : 0 ) , n ) ;  
       	 	       n . h t m l N o d e . o b j B e l o n g = n ;  
       	 	     }  
  
                   i f ( i m a g e 1 )   n . i m a g e s [ 0 ] = i m a g e 1 ;  
                   i f ( i m a g e 2 )   n . i m a g e s [ 1 ] = i m a g e 2 ;  
                   i f ( i m a g e 3 )   n . i m a g e s [ 2 ] = i m a g e 3 ;  
  
  
                   v a r   t r = t h i s . _ d r a w N e w T r ( n . h t m l N o d e ) ;  
                   i f   ( ( t h i s . X M L l o a d i n g W a r n i n g ) | | ( t h i s . _ h A d I ) )  
                         n . h t m l N o d e . p a r e n t N o d e . p a r e n t N o d e . s t y l e . d i s p l a y = " n o n e " ;  
  
  
                         i f   ( ( b e f o r e N o d e ) & & ( b e f o r e N o d e . t r . n e x t S i b l i n g ) )  
                               p a r e n t O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . i n s e r t B e f o r e ( t r , b e f o r e N o d e . t r . n e x t S i b l i n g ) ;  
                         e l s e  
                               i f   ( t h i s . p a r s i n g O n = = p a r e n t O b j e c t . i d ) {  
                                     t h i s . p a r s e d A r r a y [ t h i s . p a r s e d A r r a y . l e n g t h ] = t r ;  
                                                 }  
                               e l s e  
                                       p a r e n t O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . a p p e n d C h i l d ( t r ) ;  
  
  
                               i f   ( ( b e f o r e N o d e ) & & ( ! b e f o r e N o d e . s p a n ) )   b e f o r e N o d e = n u l l ;  
  
                         i f   ( t h i s . X M L s o u r c e )   i f   ( ( c h i l d s ) & & ( c h i l d s ! = 0 ) )   n . X M L l o a d = 0 ;   e l s e   n . X M L l o a d = 1 ;  
                         n . t r = t r ;  
                         t r . n o d e m = n ;  
  
                         i f   ( p a r e n t O b j e c t . i t e m I d = = 0 )  
                                 t r . c h i l d N o d e s [ 0 ] . c l a s s N a m e = " h i d d e n R o w " ;  
  
                         i f   ( ( p a r e n t O b j e c t . _ r _ l o g i c ) | | ( t h i s . _ f r b t r ) )  
                                 t h i s . _ s e t S r c ( n . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 1 ] . c h i l d N o d e s [ 0 ] , t h i s . i m P a t h + t h i s . r a d i o A r r a y [ 0 ] ) ;  
  
  
                     i f   ( o p t i o n S t r )   {  
                           v a r   t e m p S t r = o p t i o n S t r . s p l i t ( " , " ) ;  
  
                         f o r   ( v a r   i = 0 ;   i < t e m p S t r . l e n g t h ;   i + + )  
                         {  
                               s w i t c h ( t e m p S t r [ i ] )  
                               {  
                                           c a s e   " S E L E C T " :   t h i s . s e l e c t I t e m ( i t e m I d , f a l s e ) ;   b r e a k ;  
                                     c a s e   " C A L L " :   t h i s . s e l e c t I t e m ( i t e m I d , t r u e ) ;       b r e a k ;  
                                     c a s e   " C H I L D " :     n . X M L l o a d = 0 ;     b r e a k ;  
                                     c a s e   " C H E C K E D " :  
                                           i f   ( t h i s . X M L l o a d i n g W a r n i n g )  
                                                 t h i s . s e t C h e c k L i s t + = t h i s . d l m t r + i t e m I d ;  
                                           e l s e  
                                                 t h i s . s e t C h e c k ( i t e m I d , 1 ) ;  
                                                 b r e a k ;  
                                     c a s e   " H C H E C K E D " :  
                                                 t h i s . _ s e t C h e c k ( n , " u n s u r e " ) ;  
                                                 b r e a k ;                                                  
                                     c a s e   " O P E N " :   n . o p e n M e = 1 ;     b r e a k ;  
                                     c a s e   " C L O S E " :   n . o p e n M e = 2 ;     b r e a k ;  
                               }  
                         } ;  
                     } ;  
  
             i f   ( ! t h i s . X M L l o a d i n g W a r n i n g )  
             {  
                           i f   ( ( t h i s . _ g e t O p e n S t a t e ( p a r e n t O b j e c t ) < 0 ) & & ( ! t h i s . _ h A d I ) )   t h i s . o p e n I t e m ( p a r e n t O b j e c t . i d ) ;  
  
                           i f   ( b e f o r e N o d e )  
                                 {  
                           t h i s . _ c o r r e c t P l u s ( b e f o r e N o d e ) ;  
                           t h i s . _ c o r r e c t L i n e ( b e f o r e N o d e ) ;  
                                 }  
                           t h i s . _ c o r r e c t P l u s ( p a r e n t O b j e c t ) ;  
                           t h i s . _ c o r r e c t L i n e ( p a r e n t O b j e c t ) ;  
                           t h i s . _ c o r r e c t P l u s ( n ) ;  
                           i f   ( p a r e n t O b j e c t . c h i l d s C o u n t > = 2 )  
                           {  
                                       t h i s . _ c o r r e c t P l u s ( N o d e s [ p a r e n t O b j e c t . c h i l d s C o u n t - 2 ] ) ;  
                                       t h i s . _ c o r r e c t L i n e ( N o d e s [ p a r e n t O b j e c t . c h i l d s C o u n t - 2 ] ) ;  
                           }  
                           i f   ( p a r e n t O b j e c t . c h i l d s C o u n t ! = 2 )   t h i s . _ c o r r e c t P l u s ( N o d e s [ 0 ] ) ;  
  
                   i f   ( t h i s . t s c h e c k )   t h i s . _ c o r r e c t C h e c k S t a t e s ( p a r e n t O b j e c t ) ;  
  
                         i f   ( t h i s . _ o n r a d h )   {  
 	 	 	 	 i f   ( t h i s . x m l s t a t e = = 1 ) {  
 	 	 	 	 	 v a r   o l d = t h i s . o n X L E ;  
 	 	 	 	 	 t h i s . o n X L E = f u n c t i o n ( i d ) {   t h i s . _ o n r a d h ( i t e m I d ) ;   i f   ( o l d )   o l d ( i d ) ;   }  
 	 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 	 t h i s . _ o n r a d h ( i t e m I d ) ;  
 	 	 	 }  
  
             }  
       r e t u r n   n ;  
 } ;  
  
  
 
  
 / * *  
 *           @ d e s c :   c r e a t e   n e w   n o d e   a s   a   c h i l d   t o   s p e c i f i e d   w i t h   p a r e n t I d  
 *           @ t y p e :   d e p r e c a t e d  
 *           @ p a r a m :   p a r e n t I d   -   p a r e n t   n o d e   i d  
 *           @ p a r a m :   i t e m I d   -   n e w   n o d e   i d  
 *           @ p a r a m :   i t e m T e x t   -   n e w   n o d e   t e x t  
 *           @ p a r a m :   i t e m A c t i o n H a n d l e r   -   f u n c t i o n   f i r e d   o n   n o d e   s e l e c t   e v e n t   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 1   -   i m a g e   f o r   n o d e   w i t h o u t   c h i l d r e n s ;   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 2   -   i m a g e   f o r   c l o s e d   n o d e ;   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 3   -   i m a g e   f o r   o p e n e d   n o d e   ( o p t i o n a l )  
 *           @ p a r a m :   o p t i o n S t r   -   o p t i o n s   s t r i n g   ( o p t i o n a l )                          
 *           @ p a r a m :   c h i l d s   -   n o d e   c h i l d s   f l a g   ( f o r   d y n a m i c a l   t r e e s )   ( o p t i o n a l )  
 *           @ t o p i c :   2      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . i n s e r t N e w I t e m = f u n c t i o n ( p a r e n t I d , i t e m I d , i t e m T e x t , i t e m A c t i o n H a n d l e r , i m a g e 1 , i m a g e 2 , i m a g e 3 , o p t i o n S t r , c h i l d s ) {  
             v a r   p a r e n t O b j e c t = t h i s . _ g l o b a l I d S t o r a g e F i n d ( p a r e n t I d ) ;  
             i f   ( ! p a r e n t O b j e c t )   r e t u r n   ( - 1 ) ;  
             v a r   n o d e z = t h i s . _ a t t a c h C h i l d N o d e ( p a r e n t O b j e c t , i t e m I d , i t e m T e x t , i t e m A c t i o n H a n d l e r , i m a g e 1 , i m a g e 2 , i m a g e 3 , o p t i o n S t r , c h i l d s ) ;  
 
                 r e t u r n   n o d e z ;  
       } ;  
 / * *  
 *           @ d e s c :   c r e a t e   n e w   n o d e   a s   a   c h i l d   t o   s p e c i f i e d   w i t h   p a r e n t I d  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   p a r e n t I d   -   p a r e n t   n o d e   i d  
 *           @ p a r a m :   i t e m I d   -   n e w   n o d e   i d  
 *           @ p a r a m :   i t e m T e x t   -   n e w   n o d e   l a b e l  
 *           @ p a r a m :   i t e m A c t i o n H a n d l e r   -   f u n c t i o n   f i r e d   o n   n o d e   s e l e c t   e v e n t   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 1   -   i m a g e   f o r   n o d e   w i t h o u t   c h i l d r e n s ;   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 2   -   i m a g e   f o r   c l o s e d   n o d e ;   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 3   -   i m a g e   f o r   o p e n e d   n o d e   ( o p t i o n a l )  
 *           @ p a r a m :   o p t i o n S t r   -   o p t i o n s   s t r i n g   ( o p t i o n a l )                          
 *           @ p a r a m :   c h i l d s   -   n o d e   c h i l d r e n   f l a g   ( f o r   d y n a m i c a l   t r e e s )   ( o p t i o n a l )  
 *           @ t o p i c :   2      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . i n s e r t N e w C h i l d = f u n c t i o n ( p a r e n t I d , i t e m I d , i t e m T e x t , i t e m A c t i o n H a n d l e r , i m a g e 1 , i m a g e 2 , i m a g e 3 , o p t i o n S t r , c h i l d s ) {  
             r e t u r n   t h i s . i n s e r t N e w I t e m ( p a r e n t I d , i t e m I d , i t e m T e x t , i t e m A c t i o n H a n d l e r , i m a g e 1 , i m a g e 2 , i m a g e 3 , o p t i o n S t r , c h i l d s ) ;  
       }        
 / * *      
 *           @ d e s c :   p a r s e   x m l  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   d h t m l O b j e c t   -   j s T r e e   o b j e c t  
 *           @ p a r a m :   n o d e   -   t o p   X M L   n o d e  
 *           @ p a r a m :   p a r e n t I d   -   p a r e n t   n o d e   i d  
 *           @ p a r a m :   l e v e l   -   l e v e l   o f   t r e e  
 *           @ t o p i c :   2  
 * /  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ p a r s e X M L T r e e = f u n c t i o n ( a , b , c , d , x m l ) {  
 	 	 v a r   p = n e w   x m l P o i n t e r ( x m l . g e t X M L T o p N o d e ( " t r e e " ) ) ;  
 	 	 a . _ p a r s e ( p ) ;  
 	 	 a . _ p = p ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' s p a n _ l o a d _ t r e e ' ) . i n n e r H T M L = ' ' ;  
 	 }  
 	  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ p a r s e I t e m = f u n c t i o n ( c , t e m p , p r e N o d e , b e f N o d e ) {    
 	 	 v a r   i d ;  
 	 	 i f   ( t h i s . _ s r n d   & &   ( ! t h i s . _ i d p u l l [ i d = c . g e t ( " i d " ) ]   | |   ! t h i s . _ i d p u l l [ i d ] . s p a n ) )  
 	 	 {  
 	 	 	 t h i s . _ a d d I t e m S R N D ( t e m p . i d , i d , c ) ;  
 	 	 	 r e t u r n ;    
 	 	 }  
 	 	  
     v a r   a = c . g e t _ a l l ( ) ;  
                  
                 i f   ( ( t y p e o f ( t h i s . w a i t U p d a t e X M L ) = = " o b j e c t " ) & & ( ! t h i s . w a i t U p d a t e X M L [ a . i d ] ) ) {  
 	 	 	 t h i s . _ p a r s e ( c , a . i d , 1 ) ;  
 	 	 	 r e t u r n ;  
 	 	 }          
  
 
                              
  
  
  
                                     v a r   z S T = [ ] ;  
                                     i f   ( a . s e l e c t )   z S T . p u s h ( " S E L E C T " ) ;  
                                     i f   ( a . t o p )   z S T . p u s h ( " T O P " ) ;  
                                     i f   ( a . c a l l )   n o d e A s k i n g C a l l = a . i d ;  
                                     i f   ( a . c h e c k e d = = - 1 )   z S T . p u s h ( " H C H E C K E D " ) ;  
                                           e l s e   i f   ( a . c h e c k e d )   z S T . p u s h ( " C H E C K E D " ) ;  
                                     i f   ( a . o p e n )   z S T . p u s h ( " O P E N " ) ;  
 	  
         	                     i f   ( t h i s . w a i t U p d a t e X M L ) {  
 	 	 	 	     	 	 i f   ( t h i s . _ g l o b a l I d S t o r a g e F i n d ( a . i d ) )  
 	         	                         	 v a r   n e w N o d e = t h i s . u p d a t e I t e m ( a . i d , a . t e x t , a . i m 0 , a . i m 1 , a . i m 2 , a . c h e c k e d ) ;  
 	 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 	 i f   ( n p l = = 0 )   z S T . p u s h ( " T O P " ) ;  
 	 	 	 	 	 	 	 e l s e   p r e N o d e = t e m p . c h i l d N o d e s [ n p l ] ;  
  
 	 	                                         v a r   n e w N o d e = t h i s . _ a t t a c h C h i l d N o d e ( t e m p , a . i d , a . t e x t , 0 , a . i m 0 , a . i m 1 , a . i m 2 , z S T . j o i n ( " , " ) , a . c h i l d , 0 , p r e N o d e ) ;  
 	 	 	 	 	 	 	 p r e N o d e = n u l l ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	   }  
                                     e l s e  
                                           v a r   n e w N o d e = t h i s . _ a t t a c h C h i l d N o d e ( t e m p , a . i d , a . t e x t , 0 , a . i m 0 , a . i m 1 , a . i m 2 , z S T . j o i n ( " , " ) , a . c h i l d , ( b e f N o d e | | 0 ) , p r e N o d e ) ;  
                                     i f   ( a . t o o l t i p )  
 
 	 	 	 	 	 n e w N o d e . s p a n . p a r e n t N o d e . p a r e n t N o d e . t i t l e = a . t o o l t i p ;  
  
                                     i f   ( a . s t y l e )  
                                                         i f   ( n e w N o d e . s p a n . s t y l e . c s s T e x t )  
                                                                 n e w N o d e . s p a n . s t y l e . c s s T e x t + = ( " ; " + a . s t y l e ) ;  
                                                         e l s e  
                                                                 n e w N o d e . s p a n . s e t A t t r i b u t e ( " s t y l e " , n e w N o d e . s p a n . g e t A t t r i b u t e ( " s t y l e " ) + " ;   " + a . s t y l e ) ;  
  
                                                 i f   ( a . r a d i o )   n e w N o d e . _ r _ l o g i c = t r u e ;  
  
                                     i f   ( a . n o c h e c k b o x ) {  
                                           n e w N o d e . s p a n . p a r e n t N o d e . p r e v i o u s S i b l i n g . p r e v i o u s S i b l i n g . c h i l d N o d e s [ 0 ] . s t y l e . d i s p l a y = ' n o n e ' ;  
                                           n e w N o d e . n o c h e c k b o x = t r u e ;  
                                     }  
                                                 i f   ( a . d i s a b l e d ) {  
                                                         i f   ( a . c h e c k e d ! = n u l l )   t h i s . _ s e t C h e c k ( n e w N o d e , c o n v e r t S t r i n g T o B o o l e a n ( a . c h e c k e d ) ) ;  
                                                         t h i s . d i s a b l e C h e c k b o x ( n e w N o d e , 1 ) ;  
                                                         }  
  
  
                                     n e w N o d e . _ a c c = a . c h i l d | | 0 ;  
  
                                     i f   ( t h i s . p a r s e r E x t e n s i o n )   t h i s . p a r s e r E x t e n s i o n . _ p a r s e E x t e n s i o n ( n o d e . c h i l d N o d e s [ i ] , t h i s . p a r s e r E x t e n s i o n , a . i d , p a r e n t I d ) ;  
  
                                     t h i s . s e t I t e m C o l o r ( n e w N o d e , a . a C o l , a . s C o l ) ;  
                                     i f   ( a . l o c k e d = = " 1 " )         t h i s . _ l o c k I t e m ( n e w N o d e , t r u e , t r u e ) ;  
  
                                     i f   ( ( a . i m w i d t h ) | | ( a . i m h e i g h t ) )       t h i s . s e t I c o n S i z e ( a . i m w i d t h , a . i m h e i g h t , n e w N o d e ) ;  
                                     i f   ( ( a . c l o s e a b l e = = " 0 " ) | | ( a . c l o s e a b l e = = " 1 " ) )     t h i s . s e t I t e m C l o s e a b l e ( n e w N o d e , a . c l o s e a b l e ) ;  
                                     v a r   z c a l l = " " ;  
                                     i f   ( a . t o p o f f s e t )   t h i s . s e t I t e m T o p O f f s e t ( n e w N o d e , a . t o p o f f s e t ) ;  
                                     i f   ( ( ! t h i s . s l o w P a r s e ) | | ( t y p e o f ( t h i s . w a i t U p d a t e X M L ) = = " o b j e c t " ) ) {    
                                     	 i f   ( c . s u b _ e x i s t s ( " i t e m " ) )  
                                         	 z c a l l = t h i s . _ p a r s e ( c , a . i d , 1 ) ;  
                                     }  
 
                                     i f   ( z c a l l ! = " " )   t h i s . n o d e A s k i n g C a l l = z c a l l ;  
  
        
                 c . e a c h ( " u s e r d a t a " , f u n c t i o n ( u ) {  
         	     	 	 t h i s . s e t U s e r D a t a ( c . g e t ( " i d " ) , u . g e t ( " n a m e " ) , u . c o n t e n t ( ) ) ;  
   	     	     } , t h i s )  
 	 	  
 	 	  
 	 }  
       	 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ p a r s e = f u n c t i o n ( p , p a r e n t I d , l e v e l , s t a r t ) {    
 	 	 i f   ( ! p . e x i s t s ( ) )   r e t u r n ;  
 	 	  
 	 	 t h i s . s k i p L o c k = t r u e ;   / / d i s a b l e   i t e m   l o c k i n g  
 	 	 / / l o a d i n g   f l a g s  
 	 	  
 	 	 t h i s . p a r s C o u n t = t h i s . p a r s C o u n t ? ( t h i s . p a r s C o u n t + 1 ) : 1 ;  
 	 	 t h i s . X M L l o a d i n g W a r n i n g = 1 ;  
 	 	  
 	 	 t h i s . n o d e A s k i n g C a l l = " " ;  
 	 	 i f   ( ! p a r e n t I d )   {                     / / t o p   l e v e l      
 	 	 	 p a r e n t I d = p . g e t ( " i d " ) ;  
 	 	 	 i f   ( p . g e t ( " r a d i o " ) )  
 	 	 	 	 t h i s . h t m l N o d e . _ r _ l o g i c = t r u e ;  
 	 	 	 t h i s . p a r s i n g O n = p a r e n t I d ;                                    
 	 	 	 t h i s . p a r s e d A r r a y = n e w   A r r a y ( ) ;  
 	 	 	 t h i s . s e t C h e c k L i s t = " " ;  
 	 	 }  
 	 	  
 	 	 v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( p a r e n t I d ) ;  
 	 	 i f   ( ! t e m p )   r e t u r n   d h t m l x E r r o r . t h r o w E r r o r ( " D a t a S t r u c t u r e " , " X M L   r e f f e r s   t o   n o t   e x i s t i n g   p a r e n t " ) ;  
 	    
 	 	 i f   ( ( t e m p . c h i l d s C o u n t ) & & ( ! s t a r t ) & & ( ! t h i s . _ e d s b p s ) & & ( ! t e m p . _ h a s _ t o p ) )  
                         v a r   p r e N o d e = t e m p . c h i l d N o d e s [ t e m p . c h i l d s C o u n t - 1 ] ;  
                 e l s e  
                         v a r   p r e N o d e = 0 ;  
  
                 v a r   n p l = 0 ;  
  
 	 	 p . e a c h ( " i t e m " , f u n c t i o n ( c , i ) {  
 	 	 	 	  
 	 	 t e m p . X M L l o a d = 1 ;  
 	 	 i f   ( ( t h i s . _ e p g p s ) & & ( t h i s . _ e p g p s C = = n p l ) ) {  
 	 	         t h i s . _ s e t N e x t P a g e S i g n ( t e m p , n p l + 1 * ( s t a r t | | 0 ) , l e v e l , n o d e ) ;  
 	 	         r e t u r n   - 1 ;  
 	 	 }  
 	 	 	 	  
                     t h i s . _ p a r s e I t e m ( c , t e m p , p r e N o d e ) ;    
   	     	      
 
                             n p l + + ;  
                    
  
   	     	      
             } , t h i s , s t a r t ) ;  
  
  
             i f   ( ! l e v e l )   {  
             	     p . e a c h ( " u s e r d a t a " , f u n c t i o n ( u ) {  
         	     	 	 t h i s . s e t U s e r D a t a ( p . g e t ( " i d " ) , u . g e t ( " n a m e " ) , u . c o n t e n t ( ) ) ;  
   	     	     } , t h i s ) ;  
   	     	      
 	     	   t e m p . X M L l o a d = 1 ;  
                   i f   ( t h i s . w a i t U p d a t e X M L ) {  
                         t h i s . w a i t U p d a t e X M L = f a l s e ;  
 	 	 	 f o r   ( v a r   i = t e m p . c h i l d s C o u n t - 1 ;   i > = 0 ;   i - - )  
 	 	 	 	 i f   ( t e m p . c h i l d N o d e s [ i ] . _ d m a r k )  
 	 	 	 	 	 t h i s . d e l e t e I t e m ( t e m p . c h i l d N o d e s [ i ] . i d ) ;  
 	 	 	 }  
  
                   v a r   p a r s e d N o d e T o p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( t h i s . p a r s i n g O n ) ;  
  
                   f o r   ( v a r   i = 0 ;   i < t h i s . p a r s e d A r r a y . l e n g t h ;   i + + )  
                               t e m p . h t m l N o d e . c h i l d N o d e s [ 0 ] . a p p e n d C h i l d ( t h i s . p a r s e d A r r a y [ i ] ) ;  
  
                   t h i s . l a s t L o a d e d X M L I d = p a r e n t I d ;  
                   t h i s . X M L l o a d i n g W a r n i n g = 0 ;  
  
                   v a r   c h A r r = t h i s . s e t C h e c k L i s t . s p l i t ( t h i s . d l m t r ) ;  
                   f o r   ( v a r   n = 0 ;   n < c h A r r . l e n g t h ;   n + + )  
                         i f   ( c h A r r [ n ] )   t h i s . s e t C h e c k ( c h A r r [ n ] , 1 ) ;  
  
                               i f   ( ( t h i s . X M L s o u r c e ) & & ( t h i s . t s c h e c k ) & & ( t h i s . s m c h e c k ) & & ( t e m p . i d ! = t h i s . r o o t I d ) ) {  
                                 i f   ( t e m p . c h e c k s t a t e = = = 0 )  
                                         t h i s . _ s e t S u b C h e c k e d ( 0 , t e m p ) ;  
                                 e l s e   i f   ( t e m p . c h e c k s t a t e = = = 1 )  
                                         t h i s . _ s e t S u b C h e c k e d ( 1 , t e m p ) ;  
                         }  
  
 	 	   i f   ( t h i s . o n X L E )   t h i s . o n X L E ( t h i s , p a r e n t I d ) ;  
                   t h i s . _ r e d r a w F r o m ( t h i s , n u l l , s t a r t )  
                    
        
 	 	   i f   ( p . g e t ( " o r d e r " )   & &   p . g e t ( " o r d e r " ) ! = " n o n e " )  
 	     	   	 t h i s . _ r e o r d e r B r a n c h ( t e m p , p . g e t ( " o r d e r " ) , t r u e ) ;  
 	     	   	  
 	     	   	                   i f   ( t h i s . n o d e A s k i n g C a l l ! = " " )       t h i s . s e l e c t I t e m ( t h i s . n o d e A s k i n g C a l l , t r u e ) ;  
                   i f   ( t h i s . _ b r a n c h U p d a t e )   t h i s . _ b r a n c h U p d a t e N e x t ( p ) ;  
 	           }  
  
  
             i f   ( t h i s . p a r s C o u n t = = 1 )   {  
 
  
                   t h i s . p a r s i n g O n = n u l l ;  
                   i f   ( ( ! t h i s . _ e d s b p s ) | | ( ! t h i s . _ e d s b p s A . l e n g t h ) ) {  
                   	 	 v a r   t h a t = t h i s ;  
                               	 w i n d o w . s e t T i m e o u t (   f u n c t i o n ( ) {     t h a t . c a l l E v e n t ( " o n X L E " , [ t h a t , p a r e n t I d ] ) ;   } , 1 ) ;  
                                 t h i s . x m l s t a t e = 0 ;  
                                 }  
                           t h i s . s k i p L o c k = f a l s e ;  
                   }  
             t h i s . p a r s C o u n t - - ;  
  
 
  
                 i f   ( ( t h i s . _ e p g p s ) & & ( s t a r t ) )  
                         t h i s . _ s e t P r e v P a g e S i g n ( t e m p , ( s t a r t | | 0 ) , l e v e l , n o d e ) ;  
  
             r e t u r n   t h i s . n o d e A s k i n g C a l l ;  
     } ;  
      
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ b r a n c h U p d a t e N e x t = f u n c t i o n ( p ) {  
 	 p . e a c h ( " i t e m " , f u n c t i o n ( c ) {  
 	 	 t h i s . _ b r a n c h U p d a t e + + ;  
 	 	 t h i s . s m a r t R e f r e s h I t e m ( c . g e t ( " i d " ) , c ) ;  
 	 } , t h i s )  
 	 t h i s . _ b r a n c h U p d a t e - - ;  
 }    
  
     d h t m l X T r e e O b j e c t . p r o t o t y p e . c h e c k U s e r D a t a = f u n c t i o n ( n o d e , p a r e n t I d ) {  
             i f   ( ( n o d e . n o d e T y p e = = 1 ) & & ( n o d e . t a g N a m e   = =   " u s e r d a t a " ) )  
             {  
                   v a r   n a m e = n o d e . g e t A t t r i b u t e ( " n a m e " ) ;  
                         i f   ( ( n a m e ) & & ( n o d e . c h i l d N o d e s [ 0 ] ) )  
                               t h i s . s e t U s e r D a t a ( p a r e n t I d , n a m e , n o d e . c h i l d N o d e s [ 0 ] . d a t a ) ;  
             }  
     }  
  
  
  
  
 / * *      
 *           @ d e s c :   r e s e t   t r e e   i m a g e s   f r o m   s e l e c t e d   l e v e l  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   d h t m l O b j e c t   -   t r e e  
 *           @ p a r a m :   i t e m O b j e c t   -   c u r r e n t   i t e m  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ r e d r a w F r o m = f u n c t i o n ( d h t m l O b j e c t , i t e m O b j e c t , s t a r t , v i s M o d e ) {  
             i f   ( ! i t e m O b j e c t )   {  
             v a r   t e m p x = d h t m l O b j e c t . _ g l o b a l I d S t o r a g e F i n d ( d h t m l O b j e c t . l a s t L o a d e d X M L I d ) ;  
             d h t m l O b j e c t . l a s t L o a d e d X M L I d = - 1 ;  
             i f   ( ! t e m p x )   r e t u r n   0 ;  
             }  
             e l s e   t e m p x = i t e m O b j e c t ;  
             v a r   a c c = 0 ;  
             f o r   ( v a r   i = ( s t a r t ? s t a r t - 1 : 0 ) ;   i < t e m p x . c h i l d s C o u n t ;   i + + )  
             {  
            
 	     	   i f   ( ( ! t h i s . _ b r a n c h U p d a t e ) | | ( t h i s . _ g e t O p e n S t a t e ( t e m p x ) = = 1 ) )  
 	                   i f   ( ( ! i t e m O b j e c t ) | | ( v i s M o d e = = 1 ) )   t e m p x . c h i l d N o d e s [ i ] . h t m l N o d e . p a r e n t N o d e . p a r e n t N o d e . s t y l e . d i s p l a y = " " ;  
                   i f   ( t e m p x . c h i l d N o d e s [ i ] . o p e n M e = = 1 )  
                         {  
                         t h i s . _ o p e n I t e m ( t e m p x . c h i l d N o d e s [ i ] ) ;  
                         t e m p x . c h i l d N o d e s [ i ] . o p e n M e = 0 ;  
                         }  
  
                   d h t m l O b j e c t . _ r e d r a w F r o m ( d h t m l O b j e c t , t e m p x . c h i l d N o d e s [ i ] ) ;  
 
  
             } ;  
  
             i f   ( ( ! t e m p x . u n P a r s e d ) & & ( ( t e m p x . X M L l o a d ) | | ( ! t h i s . X M L s o u r c e ) ) )  
             t e m p x . _ a c c = a c c ;  
             d h t m l O b j e c t . _ c o r r e c t L i n e ( t e m p x ) ;  
             d h t m l O b j e c t . _ c o r r e c t P l u s ( t e m p x ) ;  
 
       } ;  
  
 / * *  
 *           @ d e s c :   c r e a t e   a n d   r e t u r n   m a i n   h t m l   e l e m e n t   o f   t r e e  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c r e a t e S e l f = f u n c t i o n ( ) {  
             v a r   d i v = d o c u m e n t . c r e a t e E l e m e n t ( ' d i v ' ) ;  
             d i v . c l a s s N a m e = " c o n t a i n e r T a b l e S t y l e " ;  
             d i v . s t y l e . w i d t h = t h i s . w i d t h ;  
             d i v . s t y l e . h e i g h t = t h i s . h e i g h t ;  
             t h i s . p a r e n t O b j e c t . a p p e n d C h i l d ( d i v ) ;  
             r e t u r n   d i v ;  
       } ;  
  
 / * *  
 *           @ d e s c :   c o l l a p s e   t a r g e t   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   i t e m   o b j e c t  
 *           @ t o p i c :   4      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ x c l o s e A l l = f u n c t i o n ( i t e m O b j e c t )  
       {  
                 i f   ( i t e m O b j e c t . u n P a r s e d )   r e t u r n ;  
             i f   ( t h i s . r o o t I d ! = i t e m O b j e c t . i d )   {  
                     v a r   N o d e s = i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s ;  
                         v a r   C o u n t = N o d e s . l e n g t h ;  
  
                     f o r   ( v a r   i = 1 ;   i < C o u n t ;   i + + )  
                           N o d e s [ i ] . s t y l e . d i s p l a y = " n o n e " ;  
  
                     t h i s . _ c o r r e c t P l u s ( i t e m O b j e c t ) ;  
             }  
  
               f o r   ( v a r   i = 0 ;   i < i t e m O b j e c t . c h i l d s C o u n t ;   i + + )  
                         i f   ( i t e m O b j e c t . c h i l d N o d e s [ i ] . c h i l d s C o u n t )  
                           t h i s . _ x c l o s e A l l ( i t e m O b j e c t . c h i l d N o d e s [ i ] ) ;  
       } ;  
 / * *  
 *           @ d e s c :   e x p a n d   t a r g e t   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   i t e m   o b j e c t  
 *           @ t o p i c :   4  
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ x o p e n A l l = f u n c t i o n ( i t e m O b j e c t )  
       {  
             t h i s . _ H i d e S h o w ( i t e m O b j e c t , 2 ) ;  
             f o r   ( v a r   i = 0 ;   i < i t e m O b j e c t . c h i l d s C o u n t ;   i + + )  
                   t h i s . _ x o p e n A l l ( i t e m O b j e c t . c h i l d N o d e s [ i ] ) ;  
       } ;              
 / * *      
 *           @ d e s c :   s e t   c o r r e c t   t r e e - l i n e   a n d   n o d e   i m a g e s  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   i t e m   o b j e c t  
 *           @ t o p i c :   6      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c o r r e c t P l u s = f u n c t i o n ( i t e m O b j e c t ) {  
       	 	 i f   ( ! i t e m O b j e c t . h t m l N o d e )   r e t u r n ;  
                 v a r   i m s r c = i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . l a s t C h i l d ;  
                 v a r   i m s r c 2 = i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 2 ] . c h i l d N o d e s [ 0 ] ;  
  
               v a r   w o r k A r r a y = t h i s . l i n e A r r a y ;  
             i f   ( ( t h i s . X M L s o u r c e ) & & ( ! i t e m O b j e c t . X M L l o a d ) )  
             {  
                         v a r   w o r k A r r a y = t h i s . p l u s A r r a y ;  
 	 	 	 t h i s . _ s e t S r c ( i m s r c 2 , t h i s . i m P a t h + i t e m O b j e c t . i m a g e s [ 2 ] ) ;  
                                 i f   ( t h i s . _ t x t i m g )   r e t u r n   ( i m s r c . i n n e r H T M L = " [ + ] " ) ;  
             }  
             e l s e  
             i f   ( ( i t e m O b j e c t . c h i l d s C o u n t ) | | ( i t e m O b j e c t . u n P a r s e d ) )  
             {  
                   i f   ( ( i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 1 ] ) & & (   i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 1 ] . s t y l e . d i s p l a y ! = " n o n e "   ) )  
                         {  
                         i f   ( ! i t e m O b j e c t . w s i g n )   v a r   w o r k A r r a y = t h i s . m i n u s A r r a y ;  
 	 	 	 t h i s . _ s e t S r c ( i m s r c 2 , t h i s . i m P a t h + i t e m O b j e c t . i m a g e s [ 1 ] ) ;  
                                 i f   ( t h i s . _ t x t i m g )   r e t u r n   ( i m s r c . i n n e r H T M L = " [ - ] " ) ;  
                         }  
                   e l s e  
                         {  
                         i f   ( ! i t e m O b j e c t . w s i g n )   v a r   w o r k A r r a y = t h i s . p l u s A r r a y ;  
 	 	 	 t h i s . _ s e t S r c ( i m s r c 2 , t h i s . i m P a t h + i t e m O b j e c t . i m a g e s [ 2 ] ) ;  
                                 i f   ( t h i s . _ t x t i m g )   r e t u r n   ( i m s r c . i n n e r H T M L = " [ + ] " ) ;  
                         }  
             }  
             e l s e  
             {  
                   t h i s . _ s e t S r c ( i m s r c 2 , t h i s . i m P a t h + i t e m O b j e c t . i m a g e s [ 0 ] ) ;  
               }  
  
  
             v a r   t e m p N u m = 2 ;  
             i f   ( ! i t e m O b j e c t . t r e e N o d . t r e e L i n e s O n )   t h i s . _ s e t S r c ( i m s r c , t h i s . i m P a t h + w o r k A r r a y [ 3 ] ) ;  
             e l s e   {  
                     i f   ( i t e m O b j e c t . p a r e n t O b j e c t )   t e m p N u m = t h i s . _ g e t C o u n t S t a t u s ( i t e m O b j e c t . i d , i t e m O b j e c t . p a r e n t O b j e c t ) ;  
 	 	     t h i s . _ s e t S r c ( i m s r c , t h i s . i m P a t h + w o r k A r r a y [ t e m p N u m ] ) ;  
                   }  
       } ;  
  
 / * *  
 *           @ d e s c :   s e t   c o r r e c t   t r e e - l i n e   i m a g e s  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   i t e m   o b j e c t  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c o r r e c t L i n e = f u n c t i o n ( i t e m O b j e c t ) {  
       	     i f   ( ! i t e m O b j e c t . h t m l N o d e )   r e t u r n ;  
             v a r   s N o d e = i t e m O b j e c t . p a r e n t O b j e c t ;  
             i f   ( s N o d e )  
                   i f   ( ( t h i s . _ g e t L i n e S t a t u s ( i t e m O b j e c t . i d , s N o d e ) = = 0 ) | | ( ! t h i s . t r e e L i n e s O n ) )  
                               f o r ( v a r   i = 1 ;   i < = i t e m O b j e c t . c h i l d s C o u n t ;   i + + ) {  
                                     i f   ( ! i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ i ] )   b r e a k ;  
                                     i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ i ] . c h i l d N o d e s [ 0 ] . s t y l e . b a c k g r o u n d I m a g e = " " ;  
                                     i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ i ] . c h i l d N o d e s [ 0 ] . s t y l e . b a c k g r o u n d R e p e a t = " " ;  
                                 }  
                         e l s e  
                               f o r ( v a r   i = 1 ;   i < = i t e m O b j e c t . c h i l d s C o u n t ;   i + + ) {  
                               	   i f   ( ! i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ i ] )   b r e a k ;  
                               	   i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ i ] . c h i l d N o d e s [ 0 ] . s t y l e . b a c k g r o u n d I m a g e = " u r l ( " + t h i s . i m P a t h + t h i s . l i n e A r r a y [ 5 ] + " ) " ;  
                               	   i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ i ] . c h i l d N o d e s [ 0 ] . s t y l e . b a c k g r o u n d R e p e a t = " r e p e a t - y " ;  
 	           }  
       } ;  
 / * *  
 *           @ d e s c :   r e t u r n   t y p e   o f   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m I d   -   i t e m   i d  
 *           @ p a r a m :   i t e m O b j e c t   -   p a r e n t   n o d e   o b j e c t  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t C o u n t S t a t u s = f u n c t i o n ( i t e m I d , i t e m O b j e c t ) {  
  
             i f   ( i t e m O b j e c t . c h i l d s C o u n t < = 1 )   {   i f   ( i t e m O b j e c t . i d = = t h i s . r o o t I d )   r e t u r n   4 ;   e l s e     r e t u r n   0 ;   }  
  
             i f   ( i t e m O b j e c t . c h i l d N o d e s [ 0 ] . i d = = i t e m I d )   i f   ( ! i t e m O b j e c t . i d )   r e t u r n   2 ;   e l s e   r e t u r n   1 ;  
             i f   ( i t e m O b j e c t . c h i l d N o d e s [ i t e m O b j e c t . c h i l d s C o u n t - 1 ] . i d = = i t e m I d )   r e t u r n   0 ;  
  
             r e t u r n   1 ;  
       } ;  
 / * *  
 *           @ d e s c :   r e t u r n   t y p e   o f   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d                  
 *           @ p a r a m :   i t e m O b j e c t   -   p a r e n t   n o d e   o b j e c t  
 *           @ t o p i c :   6  
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t L i n e S t a t u s   = f u n c t i o n ( i t e m I d , i t e m O b j e c t ) {  
                   i f   ( i t e m O b j e c t . c h i l d N o d e s [ i t e m O b j e c t . c h i l d s C o u n t - 1 ] . i d = = i t e m I d )   r e t u r n   0 ;  
                   r e t u r n   1 ;  
             }  
  
 / * *      
 *           @ d e s c :   o p e n / c l o s e   n o d e    
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   n o d e   o b j e c t                  
 *           @ p a r a m :   m o d e   -   o p e n / c l o s e   m o d e   [ 1 - c l o s e   2 - o p e n ] ( o p t i o n a l )  
 *           @ t o p i c :   6  
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ H i d e S h o w = f u n c t i o n ( i t e m O b j e c t , m o d e ) {  
             i f   ( ( t h i s . X M L s o u r c e ) & & ( ! i t e m O b j e c t . X M L l o a d ) )   {  
                         i f   ( m o d e = = 1 )   r e t u r n ;   / / c l o s e   f o r   n o t   l o a d e d   n o d e   -   i g n o r e   i t  
                         i t e m O b j e c t . X M L l o a d = 1 ;  
                         t h i s . _ l o a d D y n X M L ( i t e m O b j e c t . i d ) ;  
                         r e t u r n ;   } ;  
 
             v a r   N o d e s = i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s ;   v a r   C o u n t = N o d e s . l e n g t h ;  
             i f   ( C o u n t > 1 ) {  
                   i f   (   (   ( N o d e s [ 1 ] . s t y l e . d i s p l a y ! = " n o n e " )   | |   ( m o d e = = 1 )   )   & &   ( m o d e ! = 2 )   )   {  
 / / n b : s o l v e s   s t a n d a r d   d o c t y p e   p r b   i n   I E  
                     t h i s . a l l T r e e . c h i l d N o d e s [ 0 ] . b o r d e r   =   " 1 " ;  
                     t h i s . a l l T r e e . c h i l d N o d e s [ 0 ] . b o r d e r   =   " 0 " ;  
                   n o d e s t y l e = " n o n e " ;  
                   }  
                   e l s e     n o d e s t y l e = " " ;  
  
             f o r   ( v a r   i = 1 ;   i < C o u n t ;   i + + )  
                   N o d e s [ i ] . s t y l e . d i s p l a y = n o d e s t y l e ;  
             }  
             t h i s . _ c o r r e c t P l u s ( i t e m O b j e c t ) ;  
       }  
  
 / * *  
 *           @ d e s c :   r e t u r n   n o d e   s t a t e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   n o d e   o b j e c t                  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t O p e n S t a t e = f u n c t i o n ( i t e m O b j e c t ) {  
             v a r   z = i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s ;  
             i f   ( z . l e n g t h < = 1 )   r e t u r n   0 ;  
             i f         ( z [ 1 ] . s t y l e . d i s p l a y ! = " n o n e " )   r e t u r n   1 ;  
             e l s e   r e t u r n   - 1 ;  
       }  
  
        
  
 / * *      
 *           @ d e s c :   o n d b l c l i c k   i t e m     e v e n t   h a n d l e r  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0      
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . o n R o w C l i c k 2 = f u n c t i o n ( ) {  
       	     v a r   t h a t = t h i s . p a r e n t O b j e c t . t r e e N o d ;  
             i f   ( ! t h a t . c a l l E v e n t ( " o n D b l C l i c k " , [ t h i s . p a r e n t O b j e c t . i d , t h a t ] ) )   r e t u r n   0 ;  
             i f   ( ( t h i s . p a r e n t O b j e c t . c l o s e b l e ) & & ( t h i s . p a r e n t O b j e c t . c l o s e b l e ! = " 0 " ) )  
                   t h a t . _ H i d e S h o w ( t h i s . p a r e n t O b j e c t ) ;  
             e l s e  
                   t h a t . _ H i d e S h o w ( t h i s . p a r e n t O b j e c t , 2 ) ;  
  
       	 i f         ( t h a t . c h e c k E v e n t ( " o n O p e n E n d " ) )  
                       i f   ( ! t h a t . x m l s t a t e )  
 	 	 	 	 t h a t . c a l l E v e n t ( " o n O p e n E n d " , [ t h i s . p a r e n t O b j e c t . i d , t h a t . _ g e t O p e n S t a t e ( t h i s . p a r e n t O b j e c t ) ] ) ;  
                         e l s e {  
                                 t h a t . _ o i e _ o n X L E . p u s h ( t h a t . o n X L E ) ;  
                                 t h a t . o n X L E = t h a t . _ e p n F H e ;  
                                 }                    
       } ;  
 / * *  
 *           @ d e s c :   o n c l i c k   i t e m   e v e n t   h a n d l e r  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . o n R o w C l i c k = f u n c t i o n ( ) {  
         v a r   t h a t = t h i s . p a r e n t O b j e c t . t r e e N o d ;  
 	     i f   ( ! t h a t . c a l l E v e n t ( " o n O p e n S t a r t " , [ t h i s . p a r e n t O b j e c t . i d , t h a t . _ g e t O p e n S t a t e ( t h i s . p a r e n t O b j e c t ) ] ) )   r e t u r n   0 ;  
             i f   ( ( t h i s . p a r e n t O b j e c t . c l o s e b l e ) & & ( t h i s . p a r e n t O b j e c t . c l o s e b l e ! = " 0 " ) )  
                   t h a t . _ H i d e S h o w ( t h i s . p a r e n t O b j e c t ) ;  
             e l s e  
                   t h a t . _ H i d e S h o w ( t h i s . p a r e n t O b j e c t , 2 ) ;  
 / / # o n _ o p e n _ e n d _ e v e n t : 1 1 0 5 2 0 0 6 {  
 	  
       i f         ( t h a t . c h e c k E v e n t ( " o n O p e n E n d " ) )  
                       i f   ( ! t h a t . x m l s t a t e )  
 	 	 	 	 t h a t . c a l l E v e n t ( " o n O p e n E n d " , [ t h i s . p a r e n t O b j e c t . i d , t h a t . _ g e t O p e n S t a t e ( t h i s . p a r e n t O b j e c t ) ] ) ;  
                         e l s e {  
                                 t h a t . _ o i e _ o n X L E . p u s h ( t h a t . o n X L E ) ;  
                                 t h a t . o n X L E = t h a t . _ e p n F H e ;  
                                 }  
 / / # }  
       } ;  
 / / # o n _ o p e n _ e n d _ e v e n t : 1 1 0 5 2 0 0 6 {  
             d h t m l X T r e e O b j e c t . p r o t o t y p e . _ e p n F H e = f u n c t i o n ( t h a t , i d , f l a g ) {  
             	 i f   ( i d ! = t h i s . r o o t I d )  
 	     	 	 t h i s . c a l l E v e n t ( " o n O p e n E n d " , [ i d , t h a t . g e t O p e n S t a t e ( i d ) ] ) ;  
                 t h a t . o n X L E = t h a t . _ o i e _ o n X L E . p o p ( ) ;  
                  
                 i f   ( ! f l a g   & &   ! t h a t . _ o i e _ o n X L E . l e n g t h )  
 	 	 	 i f   ( t h a t . o n X L E )   t h a t . o n X L E ( t h a t , i d ) ;  
         }  
  
 / / # }  
  
 / * *  
 *           @ d e s c :   o n c l i c k   i t e m   i m a g e   e v e n t   h a n d l e r  
 *           @ t y p e :   p r i v a t e  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   0      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . o n R o w C l i c k D o w n = f u n c t i o n ( e ) {  
                         e = e | | w i n d o w . e v e n t ;  
                   v a r   t h a t = t h i s . p a r e n t O b j e c t . t r e e N o d ;  
                   t h a t . _ s e l e c t I t e m ( t h i s . p a r e n t O b j e c t , e ) ;  
             } ;  
  
  
 / * * * * *  
 S E L E C T I O N  
 * * * * * /  
  
 / * *  
 *           @ d e s c :   r e t u n   s e l e c t e d   i t e m   i d  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   i d   o f   s e l e c t e d   i t e m  
 *           @ t o p i c :   1  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t S e l e c t e d I t e m I d = f u n c t i o n ( )  
       {  
                 v a r   s t r = n e w   A r r a y ( ) ;  
                 f o r   ( v a r   i = 0 ;   i < t h i s . _ s e l e c t e d . l e n g t h ;   i + + )   s t r [ i ] = t h i s . _ s e l e c t e d [ i ] . i d ;  
             r e t u r n   ( s t r . j o i n ( t h i s . d l m t r ) ) ;  
       } ;  
  
 / * *  
 *           @ d e s c :   v i s u a l   s e l e c t   i t e m   i n   t r e e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   n o d e   -   t r e e   i t e m   o b j e c t  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ s e l e c t I t e m = f u n c t i o n ( n o d e , e ) {  
       	 	 i f   ( t h i s . _ o n S S C F )   t h i s . _ o n S S C F o l d = t h i s . g e t S e l e c t e d I t e m I d ( ) ;  
 
                         t h i s . _ u n s e l e c t I t e m s ( ) ;  
 
 	 	 	 	 	 t h i s . _ m a r k I t e m ( n o d e ) ;  
 	 	 i f   ( t h i s . _ o n S S C F )   {  
 	 	       	 v a r   z = t h i s . g e t S e l e c t e d I t e m I d ( ) ;  
 	 	 	 i f   ( z ! = t h i s . _ o n S S C F o l d )  
 	 	 	 	 t h i s . c a l l E v e n t ( " o n S e l e c t " , [ z ] ) ;  
 	 	 }  
         }  
         d h t m l X T r e e O b j e c t . p r o t o t y p e . _ m a r k I t e m = f u n c t i o n ( n o d e ) {  
                             i f   ( n o d e . s c o l o r )     n o d e . s p a n . s t y l e . c o l o r = n o d e . s c o l o r ;  
                             n o d e . s p a n . c l a s s N a m e = " s e l e c t e d T r e e R o w " ;  
                           n o d e . i _ s e l = t r u e ;  
                           t h i s . _ s e l e c t e d [ t h i s . _ s e l e c t e d . l e n g t h ] = n o d e ;  
         }  
  
 / * *  
 *           @ d e s c :   r e t u n   n o d e   i n d e x   i n   c h i l d s   c o l l e c t i o n   b y   I d  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ r e t u r n :   n o d e   i n d e x  
 *           @ t o p i c :   2  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t I n d e x B y I d = f u n c t i o n ( i t e m I d ) {  
                   v a r   z = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
                   i f   ( ! z )   r e t u r n   n u l l ;  
                   r e t u r n   t h i s . _ g e t I n d e x ( z ) ;  
       } ;  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t I n d e x = f u n c t i o n ( w ) {  
                 v a r   z = w . p a r e n t O b j e c t ;  
                 f o r   ( v a r   i = 0 ;   i < z . c h i l d s C o u n t ;   i + + )  
                         i f   ( z . c h i l d N o d e s [ i ] = = w )   r e t u r n   i ;  
       } ;  
  
  
  
  
  
 / * *  
 *           @ d e s c :   v i s u a l   u n s e l e c t   i t e m   i n   t r e e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   n o d e   -   t r e e   i t e m   o b j e c t  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ u n s e l e c t I t e m = f u n c t i o n ( n o d e ) {  
                 i f   ( ( n o d e ) & & ( n o d e . i _ s e l ) )  
                         {  
  
                     n o d e . s p a n . c l a s s N a m e = " s t a n d a r t T r e e R o w " ;  
                     i f   ( n o d e . a c o l o r )     n o d e . s p a n . s t y l e . c o l o r = n o d e . a c o l o r ;  
                         n o d e . i _ s e l = f a l s e ;  
                         f o r   ( v a r   i = 0 ;   i < t h i s . _ s e l e c t e d . l e n g t h ;   i + + )  
                                         i f   ( ! t h i s . _ s e l e c t e d [ i ] . i _ s e l )   {  
                                                 t h i s . _ s e l e c t e d . s p l i c e ( i , 1 ) ;  
                                                 b r e a k ;  
                                   }  
  
                         }  
               }  
  
 / * *  
 *           @ d e s c :   v i s u a l   u n s e l e c t   i t e m   i n   t r e e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   n o d e   -   t r e e   i t e m   o b j e c t  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ u n s e l e c t I t e m s = f u n c t i o n ( ) {  
             f o r   ( v a r   i = 0 ;   i < t h i s . _ s e l e c t e d . l e n g t h ;   i + + ) {  
                         v a r   n o d e = t h i s . _ s e l e c t e d [ i ] ;  
                   n o d e . s p a n . c l a s s N a m e = " s t a n d a r t T r e e R o w " ;  
                     i f   ( n o d e . a c o l o r )     n o d e . s p a n . s t y l e . c o l o r = n o d e . a c o l o r ;  
                   n o d e . i _ s e l = f a l s e ;  
                   }  
                   t h i s . _ s e l e c t e d = n e w   A r r a y ( ) ;  
               }  
  
  
 / * *      
 *           @ d e s c :   s e l e c t   n o d e   t e x t   e v e n t   h a n d l e r  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   e   -   e v e n t   o b j e c t  
 *           @ p a r a m :   h t m l O b j e c t   -   n o d e   o b j e c t            
 *           @ p a r a m :   m o d e   -   i f   f a l s e   -   c a l l   o n S e l e c t   e v e n t  
 *           @ t o p i c :   0      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . o n R o w S e l e c t = f u n c t i o n ( e , h t m l O b j e c t , m o d e ) {  
             e = e | | w i n d o w . e v e n t ;  
  
                 v a r   o b j = t h i s . p a r e n t O b j e c t ;  
             i f   ( h t m l O b j e c t )   o b j = h t m l O b j e c t . p a r e n t O b j e c t ;  
                 v a r   t h a t = o b j . t r e e N o d ;  
  
                 v a r   l a s t I d = t h a t . g e t S e l e c t e d I t e m I d ( ) ;  
 	 	 i f   ( ( ! e ) | | ( ! e . s k i p U n S e l ) )  
 	                 t h a t . _ s e l e c t I t e m ( o b j , e ) ;  
  
             i f   ( ! m o d e )   {  
                   i f   ( ( e ) & & ( e . b u t t o n = = 2 ) )  
 	 	   	 t h a t . c a l l E v e n t ( " o n R i g h t C l i c k " , [ o b j . i d , e ] ) ;  
 	 	   	  
                   i f   ( o b j . a c t i o n H a n d l e r )   o b j . a c t i o n H a n d l e r ( o b j . i d , l a s t I d ) ;  
 	 	   e l s e   t h a t . c a l l E v e n t ( " o n C l i c k " , [ o b j . i d , l a s t I d ] ) ;  
                   }  
       } ;  
  
  
  
  
        
 / * *  
 *           @ d e s c :   f i x   c h e c k b o x   s t a t e  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c o r r e c t C h e c k S t a t e s = f u n c t i o n ( d h t m l O b j e c t ) {  
 	  
       i f   ( ! t h i s . t s c h e c k )   r e t u r n ;  
       i f   ( ! d h t m l O b j e c t )   r e t u r n ;  
       i f   ( d h t m l O b j e c t . i d = = t h i s . r o o t I d )   r e t u r n ;  
       / / c a l c u l a t e   s t a t e  
       v a r   a c t = d h t m l O b j e c t . c h i l d N o d e s ;  
       v a r   f l a g 1 = 0 ;   v a r   f l a g 2 = 0 ;  
       i f   ( d h t m l O b j e c t . c h i l d s C o u n t = = 0 )   r e t u r n ;  
       f o r   ( v a r   i = 0 ;   i < d h t m l O b j e c t . c h i l d s C o u n t ;   i + + ) {  
       	     i f   ( a c t [ i ] . d s c h e c k )   c o n t i n u e ;  
             i f   ( a c t [ i ] . c h e c k s t a t e = = 0 )   f l a g 1 = 1 ;  
             e l s e   i f   ( a c t [ i ] . c h e c k s t a t e = = 1 )   f l a g 2 = 1 ;  
                   e l s e   {   f l a g 1 = 1 ;   f l a g 2 = 1 ;   b r e a k ;   }  
 	 	   }  
  
       i f   ( ( f l a g 1 ) & & ( f l a g 2 ) )   t h i s . _ s e t C h e c k ( d h t m l O b j e c t , " u n s u r e " ) ;  
       e l s e   i f   ( f l a g 1 )     t h i s . _ s e t C h e c k ( d h t m l O b j e c t , f a l s e ) ;  
             e l s e     t h i s . _ s e t C h e c k ( d h t m l O b j e c t , t r u e ) ;  
  
             t h i s . _ c o r r e c t C h e c k S t a t e s ( d h t m l O b j e c t . p a r e n t O b j e c t ) ;  
 }  
  
 / * *  
 *           @ d e s c :   c h e c b o x   s e l e c t   a c t i o n  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0  
 * /        
       d h t m l X T r e e O b j e c t . p r o t o t y p e . o n C h e c k B o x C l i c k = f u n c t i o n ( e ) {  
 	       	     i f   ( ! t h i s . t r e e N o d . c a l l E v e n t ( " o n B e f o r e C h e c k " , [ t h i s . p a r e n t O b j e c t . i d , t h i s . p a r e n t O b j e c t . c h e c k s t a t e ] ) )  
 	       	     	 r e t u r n ;  
       	      
             i f   ( t h i s . p a r e n t O b j e c t . d s c h e c k )   r e t u r n   t r u e ;  
             i f   ( t h i s . t r e e N o d . t s c h e c k )  
                   i f   ( t h i s . p a r e n t O b j e c t . c h e c k s t a t e = = 1 )   t h i s . t r e e N o d . _ s e t S u b C h e c k e d ( f a l s e , t h i s . p a r e n t O b j e c t ) ;  
                   e l s e   t h i s . t r e e N o d . _ s e t S u b C h e c k e d ( t r u e , t h i s . p a r e n t O b j e c t ) ;  
             e l s e  
                   i f   ( t h i s . p a r e n t O b j e c t . c h e c k s t a t e = = 1 )   t h i s . t r e e N o d . _ s e t C h e c k ( t h i s . p a r e n t O b j e c t , f a l s e ) ;  
                   e l s e   t h i s . t r e e N o d . _ s e t C h e c k ( t h i s . p a r e n t O b j e c t , t r u e ) ;  
             t h i s . t r e e N o d . _ c o r r e c t C h e c k S t a t e s ( t h i s . p a r e n t O b j e c t . p a r e n t O b j e c t ) ;  
  
             r e t u r n   t h i s . t r e e N o d . c a l l E v e n t ( " o n C h e c k " , [ t h i s . p a r e n t O b j e c t . i d , t h i s . p a r e n t O b j e c t . c h e c k s t a t e ] ) ;  
       } ;  
 / * *  
 *           @ d e s c :   c r e a t e   H T M L   e l e m e n t s   f o r   t r e e   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   a c h e c k   -   e n a b l e / d i s a b l e   c h e c k b o x  
 *           @ p a r a m :   i t e m O b j e c t   -   i t e m   o b j e c t  
 *           @ p a r a m :   m o d e   -   m o d e  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c r e a t e I t e m = f u n c t i o n ( a c h e c k , i t e m O b j e c t , m o d e ) {  
  
 	   v a r   t a b l e = d o c u m e n t . c r e a t e E l e m e n t ( ' t a b l e ' ) ;  
 	   t a b l e . c e l l S p a c i n g = 0 ; t a b l e . c e l l P a d d i n g = 0 ;  
 	   t a b l e . b o r d e r = 0 ;  
  
 	   i f ( t h i s . h f M o d e ) t a b l e . s t y l e . t a b l e L a y o u t = " f i x e d " ;  
 	   t a b l e . s t y l e . m a r g i n = 0 ; t a b l e . s t y l e . p a d d i n g = 0 ;  
  
 	   v a r   t b o d y = d o c u m e n t . c r e a t e E l e m e n t ( ' t b o d y ' ) ;  
 	   v a r   t r = d o c u m e n t . c r e a t e E l e m e n t ( ' t r ' ) ;  
  
 	   v a r   t d 1 = d o c u m e n t . c r e a t e E l e m e n t ( ' t d ' ) ;  
 	   t d 1 . c l a s s N a m e = " s t a n d a r t T r e e I m a g e " ;  
  
 	   i f ( t h i s . _ t x t i m g ) {  
 	 	   v a r   i m g 0 = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ;  
 	 	   t d 1 . a p p e n d C h i l d ( i m g 0 ) ;  
 	 	   i m g 0 . c l a s s N a m e = " d h x _ t r e e _ t e x t S i g n " ;  
 	 }  
                         e l s e  
                         {  
                   v a r   i m g 0 = t h i s . _ g e t I m g ( i t e m O b j e c t . i d ) ;  
                         i m g 0 . b o r d e r = " 0 " ;  
                         i f   ( i m g 0 . t a g N a m e = = " I M G " )   i m g 0 . a l i g n = " a b s m i d d l e " ;  
                         t d 1 . a p p e n d C h i l d ( i m g 0 ) ;   i m g 0 . s t y l e . p a d d i n g = 0 ;   i m g 0 . s t y l e . m a r g i n = 0 ;  
 	 	 	 i m g 0 . s t y l e . w i d t h = t h i s . d e f _ l i n e _ i m g _ x ;   i m g 0 . s t y l e . h e i g h t = t h i s . d e f _ l i n e _ i m g _ y ;  
                         }  
  
             v a r   t d 1 1 = d o c u m e n t . c r e a t e E l e m e n t ( ' t d ' ) ;  
 / /                   v a r   i n p = d o c u m e n t . c r e a t e E l e m e n t ( " i n p u t " ) ;                         i n p . t y p e = " c h e c k b o x " ;   i n p . s t y l e . w i d t h = " 1 2 p x " ;   i n p . s t y l e . h e i g h t = " 1 2 p x " ;  
                   v a r   i n p = t h i s . _ g e t I m g ( t h i s . c B R O f ? t h i s . r o o t I d : i t e m O b j e c t . i d ) ;  
                   i n p . c h e c k e d = 0 ;   t h i s . _ s e t S r c ( i n p , t h i s . i m P a t h + t h i s . c h e c k A r r a y [ 0 ] ) ;   i n p . s t y l e . w i d t h = " 1 6 p x " ;   i n p . s t y l e . h e i g h t = " 1 6 p x " ;  
                         / / c a n   c a u s e   p r o b l e m s   w i t h   h i d e / s h o w   c h e c k  
                   i f   ( ! a c h e c k )   ( ( ( _ i s O p e r a ) | | ( _ i s K H T M L ) ) ? t d 1 1 : i n p ) . s t y l e . d i s p l a y = " n o n e " ;  
  
                   / /   t d 1 1 . c l a s s N a m e = " s t a n d a r t T r e e I m a g e " ;  
                               / / i f   ( a c h e c k )  
                         t d 1 1 . a p p e n d C h i l d ( i n p ) ;  
                         i f   ( ( ! t h i s . c B R O f ) & & ( i n p . t a g N a m e = = " I M G " ) )   i n p . a l i g n = " a b s m i d d l e " ;  
                         i n p . o n c l i c k = t h i s . o n C h e c k B o x C l i c k ;  
                         i n p . t r e e N o d = t h i s ;  
                         i n p . p a r e n t O b j e c t = i t e m O b j e c t ;  
                         t d 1 1 . w i d t h = " 2 0 p x " ;  
  
             v a r   t d 1 2 = d o c u m e n t . c r e a t e E l e m e n t ( ' t d ' ) ;  
                   t d 1 2 . c l a s s N a m e = " s t a n d a r t T r e e I m a g e " ;  
                   v a r   i m g = t h i s . _ g e t I m g ( t h i s . t i m g e n ? i t e m O b j e c t . i d : t h i s . r o o t I d ) ;  
 	 	   	 i m g . o n m o u s e d o w n = t h i s . _ p r e v e n t N s D r a g ;   i m g . o n d r a g s t a r t = t h i s . _ p r e v e n t N s D r a g ;  
                         i m g . b o r d e r = " 0 " ;  
                         i f   ( t h i s . _ a i m g s ) {  
                               i m g . p a r e n t O b j e c t = i t e m O b j e c t ;  
                               i f   ( i m g . t a g N a m e = = " I M G " )   i m g . a l i g n = " a b s m i d d l e " ;  
                               i m g . o n c l i c k = t h i s . o n R o w S e l e c t ;   }  
                         i f   ( ! m o d e )   t h i s . _ s e t S r c ( i m g , t h i s . i m P a t h + t h i s . i m a g e A r r a y [ 0 ] ) ;  
                         t d 1 2 . a p p e n d C h i l d ( i m g ) ;   i m g . s t y l e . p a d d i n g = 0 ;   i m g . s t y l e . m a r g i n = 0 ;  
                   i f   ( t h i s . t i m g e n )  
                         {     i m g . s t y l e . w i d t h = t h i s . d e f _ i m g _ x ;   i m g . s t y l e . h e i g h t = t h i s . d e f _ i m g _ y ;   }  
                   e l s e  
                         {  
                                 i m g . s t y l e . w i d t h = " 0 p x " ;   i m g . s t y l e . h e i g h t = " 0 p x " ;  
                                 i f   ( _ i s O p e r a )         t d 1 2 . s t y l e . d i s p l a y = " n o n e " ;  
                                 }  
  
  
             v a r   t d 2 = d o c u m e n t . c r e a t e E l e m e n t ( ' t d ' ) ;  
                   t d 2 . c l a s s N a m e = " s t a n d a r t T r e e R o w " ;  
  
                         i t e m O b j e c t . s p a n = d o c u m e n t . c r e a t e E l e m e n t ( ' s p a n ' ) ;  
                         i t e m O b j e c t . s p a n . c l a s s N a m e = " s t a n d a r t T r e e R o w " ;  
                         i f   ( t h i s . m l i t e m s )   {  
 	 	 	 	 i t e m O b j e c t . s p a n . s t y l e . w i d t h = t h i s . m l i t e m s ;  
 	 	 	       / / 	 i f   ( ! _ i s I E )  
 	 	 	 	 	 i t e m O b j e c t . s p a n . s t y l e . d i s p l a y = " b l o c k " ;  
 	 	 	 	 }  
                         e l s e   t d 2 . n o W r a p = t r u e ;  
                                 i f   ( ! _ i s K H T M L )   t d 2 . s t y l e . w i d t h = " 1 0 0 % " ;  
  
 / /             i t e m O b j e c t . s p a n . a p p e n d C h i l d ( d o c u m e n t . c r e a t e T e x t N o d e ( i t e m O b j e c t . l a b e l ) ) ;  
                   i t e m O b j e c t . s p a n . i n n e r H T M L = i t e m O b j e c t . l a b e l ;  
             t d 2 . a p p e n d C h i l d ( i t e m O b j e c t . s p a n ) ;  
             t d 2 . p a r e n t O b j e c t = i t e m O b j e c t ;                 t d 1 . p a r e n t O b j e c t = i t e m O b j e c t ;  
             t d 2 . o n c l i c k = t h i s . o n R o w S e l e c t ;   t d 1 . o n c l i c k = t h i s . o n R o w C l i c k ;   t d 2 . o n d b l c l i c k = t h i s . o n R o w C l i c k 2 ;  
             i f   ( t h i s . e t t i p )  
 
 	 	     	 t r . t i t l e = i t e m O b j e c t . l a b e l ;  
  
             i f   ( t h i s . d r a g A n d D r o p O f f )   {  
                   i f   ( t h i s . _ a i m g s )   {   t h i s . d r a g g e r . a d d D r a g g a b l e I t e m ( t d 1 2 , t h i s ) ;   t d 1 2 . p a r e n t O b j e c t = i t e m O b j e c t ;   }  
                   t h i s . d r a g g e r . a d d D r a g g a b l e I t e m ( t d 2 , t h i s ) ;  
                   }  
  
             i t e m O b j e c t . s p a n . s t y l e . p a d d i n g L e f t = " 5 p x " ;             i t e m O b j e c t . s p a n . s t y l e . p a d d i n g R i g h t = " 5 p x " ;       t d 2 . s t y l e . v e r t i c a l A l i g n = " " ;  
               t d 2 . s t y l e . f o n t S i z e = " 1 0 p t " ;               t d 2 . s t y l e . c u r s o r = t h i s . s t y l e _ p o i n t e r ;  
             t r . a p p e n d C h i l d ( t d 1 ) ;                         t r . a p p e n d C h i l d ( t d 1 1 ) ;                         t r . a p p e n d C h i l d ( t d 1 2 ) ;  
             t r . a p p e n d C h i l d ( t d 2 ) ;  
             t b o d y . a p p e n d C h i l d ( t r ) ;  
             t a b l e . a p p e n d C h i l d ( t b o d y ) ;  
  
 	     i f   ( t h i s . e h l t ) { / / h i g h l i g h t i n g  
 	 	 t r . o n m o u s e m o v e = t h i s . _ i t e m M o u s e I n ;  
                 t r [ ( _ i s I E ) ? " o n m o u s e l e a v e " : " o n m o u s e o u t " ] = t h i s . _ i t e m M o u s e O u t ;  
             }  
 	     i f ( t h i s . c h e c k E v e n t   & &   t h i s . c h e c k E v e n t ( " o n R i g h t C l i c k " ) )  
 	 	   t r . o n c o n t e x t m e n u = F u n c t i o n ( " e " , " t h i s . c h i l d N o d e s [ 0 ] . p a r e n t O b j e c t . t r e e N o d . c a l l E v e n t ( ' o n R i g h t C l i c k ' , [ t h i s . c h i l d N o d e s [ 0 ] . p a r e n t O b j e c t . i d , ( e | | w i n d o w . e v e n t ) ] ) ;   r e t u r n   f a l s e ; " ) ;  
  
  
             r e t u r n   t a b l e ;  
       } ;  
        
  
 / * *      
 *           @ d e s c :   s e t   p a t h   t o   i m a g e   d i r e c t o r y  
 *           @ p a r a m :   n e w P a t h   -   p a t h   t o   i m a g e   d i r e c t o r y  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I m a g e P a t h = f u n c t i o n (   n e w P a t h   ) {   t h i s . i m P a t h = n e w P a t h ;   } ;  
  
 
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   t r e e   n o d e   s e l e c t e d  
 *           @ p a r a m :   ( f u n c t i o n )   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :   o n R i g h t C l i c k  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n R i g h t C l i c k " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :     E v e n t   o c c u r e d   a f t e r   r i g h t   m o u s e   b u t t o n   w a s   c l i c k e d .  
                   A s s i g n i n g   t h i s   h a n d l e r   c a n   d i s a b l e   d e f a u l t   c o n t e x t   m e n u ,   a n d   n o n c o m p a t t i b l e   w i t h   d h t m l X M e n u   i n t e g r a t i o n .  
 *           @ e v e n t p a r a m :   ( s t r i n g )   I D   o f   c l i c k e d   i t e m  
 *           @ e v e n t p a r a m :   ( o b j e c t )   e v e n t   o b j e c t  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n R i g h t C l i c k H a n d l e r = f u n c t i o n ( f u n c ) {     t h i s . a t t a c h E v e n t ( " o n R i g h t C l i c k " , f u n c ) ;       } ;  
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   t r e e   n o d e   c l i c k e d ,   a l s o   c a n   b e   f o r c e d   t o   c a l l   f r o m   A P I  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :   o n C l i c k  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n C l i c k " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   t e x t   p a r t   o f   i t e m   i n   t r e e   w a s   c l i c k e d ,   b u t   a f t e r   d e f a u l t   o n C l i c k   f u n c t i o n a l i t y   w a s   p r o c e s s e d .  
                             R i c h t   m o u s e   b u t t o n   c l i c k   c a n   b e   c a t c h e d   b y   o n R i g h t C l i c k   h a n d l e r .  
 *           @ e v e n t p a r a m :     I D   o f   c l i c k e d   i t e m  
 *           @ e v e n t p a r a m :     I D   o f   p r e v i o u s l y   s e l e c t e d   i t e m  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n C l i c k H a n d l e r = f u n c t i o n ( f u n c ) {     t h i s . a t t a c h E v e n t ( " o n C l i c k " , f u n c ) ;     } ;  
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   t r e e   n o d e   s e l e c t e d   o r   u n s e l e c t e d ,   i n c l u d e   a n y   s e l e c t   c h a n g e   c a u s e d   b y   a n y   f u n c t i o n a l i t y  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :   o n S e l e c t  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n S e l e c t " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   s e l e c t i o n   i n   t r e e   w a s   c h a n g e d  
 *           @ e v e n t p a r a m :     s e l e c t e d   i t e m   I D   (   l i s t   o f   I D s   i n   c a s e   o f   m u l t i s e l e c t i o n )  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n S e l e c t S t a t e C h a n g e = f u n c t i o n ( f u n c ) {     t h i s . a t t a c h E v e n t ( " o n S e l e c t " , f u n c ) ;   t h i s . _ o n S S C F = t r u e ;     } ;  
  
  
 / * *  
 *           @ d e s c :   e n a b l e s   d y n a m i c   l o a d i n g   f r o m   X M L  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   f i l e P a t h   -   n a m e   o f   s c r i p t   r e t u r n i n g   X M L ;   i n   c a s e   o f   v i r t u a l   l o a d i n g   -   u s e r   d e f i n e d   f u n c t i o n  
 *           @ t o p i c :   0      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t X M L A u t o L o a d i n g = f u n c t i o n ( f i l e P a t h ) {     t h i s . X M L s o u r c e = f i l e P a t h ;   } ;  
  
       / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   b e f o r e   c h e c k b o x   c h e c k e d / u n c h e c k e d  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :   o n C h e c k  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n C h e c k " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   i t e m   i n   t r e e   w a s   c h e c k e d / u n c h e c k e d .  
 *           @ e v e n t p a r a m :   I D   o f   i t e m   w h i c h   w i l l   b e   c h e c k e d / u n c h e c k e d  
 *           @ e v e n t p a r a m :   C u r r e n t   c h e c k b o x   s t a t e .   1   -   i t e m   c h e c k e d ,   0   -   i t e m   u n c h e c k e d .  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n C h e c k H a n d l e r = f u n c t i o n ( f u n c ) {   t h i s . a t t a c h E v e n t ( " o n C h e c k " , f u n c ) ;     } ;  
  
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   b e f o r e   t r e e   n o d e   o p e n e d / c l o s e d  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   d e p r e c a t e d  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :     o n O p e n  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n O p e n S t a r t " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   i t e m   i n   t r e e   g o t   c o m m a n d   t o   o p e n / c l o s e   ,   a n d   b e f o r e   i t e m   w a s   o p e n e d / / c l o s e d .   E v e n t   a l s o   r a i s e d   f o r   u n c l o s a b l e   n o d e s   a n d   n o d e s   w i t h o u t   o p e n / c l o s e   f u n c t i o n a l i t y   -   i n   t h a t   c a s e   r e s u l t   o f   f u n c t i o n   w i l l   b e   i g n o r e d .  
                         E v e n t   n o t   r a i s e d   i f   n o d e   o p e n e d   b y   d h t m l X t r e e   A P I .  
 *           @ e v e n t p a r a m :   I D   o f   n o d e   w h i c h   w i l l   b e   o p e n e d / c l o s e d  
 *           @ e v e n t p a r a m :   C u r r e n t   o p e n   s t a t e   o f   t r e e   i t e m .   0   -   i t e m   h a s   n o t   c h i l d s ,   - 1   -   i t e m   c l o s e d ,   1   -   i t e m   o p e n e d .  
 *           @ e v e n t r e t u r n :   t r u e   -   c o n f i r m   o p e n i n g / c l o s i n g ;   f a l s e   -   d e n y   o p e n i n g / c l o s i n g ;  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n O p e n H a n d l e r = f u n c t i o n ( f u n c ) {     t h i s . a t t a c h E v e n t ( " o n O p e n S t a r t " , f u n c ) ;       } ;  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   b e f o r e   t r e e   n o d e   o p e n e d / c l o s e d  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :     o n O p e n S t a r t  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n O p e n S t a r t " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   i t e m   i n   t r e e   g o t   c o m m a n d   t o   o p e n / c l o s e   ,   a n d   b e f o r e   i t e m   w a s   o p e n e d / / c l o s e d .   E v e n t   a l s o   r a i s e d   f o r   u n c l o s a b l e   n o d e s   a n d   n o d e s   w i t h o u t   o p e n / c l o s e   f u n c t i o n a l i t y   -   i n   t h a t   c a s e   r e s u l t   o f   f u n c t i o n   w i l l   b e   i g n o r e d .  
                         E v e n t   n o t   r a i s e d   i f   n o d e   o p e n e d   b y   d h t m l X t r e e   A P I .  
 *           @ e v e n t p a r a m :   I D   o f   n o d e   w h i c h   w i l l   b e   o p e n e d / c l o s e d  
 *           @ e v e n t p a r a m :   C u r r e n t   o p e n   s t a t e   o f   t r e e   i t e m .   0   -   i t e m   h a s   n o t   c h i l d s ,   - 1   -   i t e m   c l o s e d ,   1   -   i t e m   o p e n e d .  
 *           @ e v e n t r e t u r n :   t r u e   -   c o n f i r m   o p e n i n g / c l o s i n g ;   f a l s e   -   d e n y   o p e n i n g / c l o s i n g ;  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n O p e n S t a r t H a n d l e r = f u n c t i o n ( f u n c ) {     t h i s . a t t a c h E v e n t ( " o n O p e n S t a r t " , f u n c ) ;         } ;  
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   a f t e r   t r e e   n o d e   o p e n e d / c l o s e d  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :     o n O p e n E n d  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n O p e n E n d " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   i t e m   i n   t r e e   g o t   c o m m a n d   t o   o p e n / c l o s e   ,   a n d   b e f o r e   i t e m   w a s   o p e n e d / / c l o s e d .   E v e n t   a l s o   r a i s e d   f o r   u n c l o s a b l e   n o d e s   a n d   n o d e s   w i t h o u t   o p e n / c l o s e   f u n c t i o n a l i t y   -   i n   t h a t   c a s e   r e s u l t   o f   f u n c t i o n   w i l l   b e   i g n o r e d .  
                         E v e n t   n o t   r a i s e d   i f   n o d e   o p e n e d   b y   d h t m l X t r e e   A P I .  
 *           @ e v e n t p a r a m :   I D   o f   n o d e   w h i c h   w i l l   b e   o p e n e d / c l o s e d  
 *           @ e v e n t p a r a m :   C u r r e n t   o p e n   s t a t e   o f   t r e e   i t e m .   0   -   i t e m   h a s   n o t   c h i l d s ,   - 1   -   i t e m   c l o s e d ,   1   -   i t e m   o p e n e d .  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n O p e n E n d H a n d l e r = f u n c t i o n ( f u n c ) {     t h i s . a t t a c h E v e n t ( " o n O p e n E n d " , f u n c ) ;     } ;  
  
       / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   t r e e   n o d e   d o u b l e   c l i c k e d  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :   o n D b l C l i c k  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n D b l C l i c k " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   i t e m   i n   t r e e   w a s   d o u b l e c l i c k e d ,   b e f o r e   d e f a u l t   o n D b l C l i c k   f u n c t i o n a l i t y   w a s   p r o c e s s e d .  
                   B e w a r e   u s i n g   b o t h   o n C l i c k   a n d   o n D b l C l i c k   e v e n t s ,   b e c a u s e   c o m p o n e n t   c a n     g e n e r a t e   o n C l i c k   e v e n t   b e f o r e   o n D b l C l i c k   e v e n t   w h i l e   d o u b l e c l i c k i n g   i t e m   i n   t r e e .  
                   (   t h a t   b e h a v i o r   d e p e n d   o n   u s e d   b r o w s e r   )  
 *           @ e v e n t p a r a m :     I D   o f   i t e m   w h i c h   w a s   d o u b l e c l i c k e d  
 *           @ e v e n t r e t u r n :     t r u e   -   c o n f i r m   o p e n i n g / c l o s i n g ;   f a l s e   -   d e n y   o p e n i n g / c l o s i n g ;  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n D b l C l i c k H a n d l e r = f u n c t i o n ( f u n c ) {   t h i s . a t t a c h E v e n t ( " o n D b l C l i c k " , f u n c ) ;       } ;  
  
  
  
  
  
  
  
  
  
       / * *  
 *           @ d e s c :   e x p a n d   t a r g e t   n o d e   a n d   a l l   c h i l d   n o d e s  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ t o p i c :   4  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . o p e n A l l I t e m s = f u n c t i o n ( i t e m I d )  
       {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             t h i s . _ x o p e n A l l ( t e m p ) ;  
       } ;  
        
 / * *  
 *           @ d e s c :   r e t u r n   o p e n / c l o s e   s t a t e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ r e t u r n :   - 1   -   c l o s e ,   1   -   o p e n e d ,   0   -   n o d e   d o e n ' t   h a v e   c h i l d s  
 *           @ t o p i c :   4  
 * /        
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t O p e n S t a t e = f u n c t i o n ( i t e m I d ) {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   " " ;  
             r e t u r n   t h i s . _ g e t O p e n S t a t e ( t e m p ) ;  
       } ;  
  
 / * *      
 *           @ d e s c :   c o l l a p s e   t a r g e t   n o d e   a n d   a l l   c h i l d   n o d e s  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ t o p i c :   4      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . c l o s e A l l I t e m s = f u n c t i o n ( i t e m I d )  
       {  
                 i f   ( i t e m I d = = = w i n d o w . u n d e f i n e d )   i t e m I d = t h i s . r o o t I d ;  
                  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             t h i s . _ x c l o s e A l l ( t e m p ) ;  
  
 / / n b : s o l v e s   s t a n d a r d   d o c t y p e   p r b   i n   I E  
                   t h i s . a l l T r e e . c h i l d N o d e s [ 0 ] . b o r d e r   =   " 1 " ;  
               t h i s . a l l T r e e . c h i l d N o d e s [ 0 ] . b o r d e r   =   " 0 " ;  
  
       } ;  
        
        
 / * *  
 *           @ d e s c :   s e t   u s e r   d a t a   f o r   t a r g e t   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   t a r g e t   n o d e   i d  
 *           @ p a r a m :   n a m e   -   k e y   f o r   u s e r   d a t a  
 *           @ p a r a m :   v a l u e   -   u s e r   d a t a  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t U s e r D a t a = f u n c t i o n ( i t e m I d , n a m e , v a l u e ) {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d , 0 , t r u e ) ;  
                   i f   ( ! s N o d e )   r e t u r n ;  
                   i f ( n a m e = = " h i n t " )  
 
 	 	 	   s N o d e . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . t i t l e = v a l u e ;  
                         i f   ( t y p e o f ( s N o d e . u s e r D a t a [ " t _ " + n a m e ] ) = = " u n d e f i n e d " ) {  
                                   i f   ( ! s N o d e . _ u s e r d a t a l i s t )   s N o d e . _ u s e r d a t a l i s t = n a m e ;  
                                 e l s e   s N o d e . _ u s e r d a t a l i s t + = " , " + n a m e ;  
                         }  
                         s N o d e . u s e r D a t a [ " t _ " + n a m e ] = v a l u e ;  
       } ;  
        
 / * *      
 *           @ d e s c :   r e t u r n   u s e r   d a t a   f r o m   t a r g e t   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   t a r g e t   n o d e   i d  
 *           @ p a r a m :   n a m e   -   k e y   f o r   u s e r   d a t a  
 *           @ r e t u r n :   v a l u e   o f   u s e r   d a t a  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t U s e r D a t a = f u n c t i o n ( i t e m I d , n a m e ) {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d , 0 , t r u e ) ;  
             i f   ( ! s N o d e )   r e t u r n ;  
             r e t u r n   s N o d e . u s e r D a t a [ " t _ " + n a m e ] ;  
       } ;  
  
  
  
  
 / * *  
 *           @ d e s c :   g e t   n o d e   c o l o r  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   c o l o r   o f   n o d e   ( e m p t y   s t r i n g   f o r   d e f a u l t   c o l o r ) ;  
 *           @ t o p i c :   6      
 * /        
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t I t e m C o l o r = f u n c t i o n ( i t e m I d )  
       {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
  
             v a r   r e s =   n e w   O b j e c t ( ) ;  
             i f   ( t e m p . a c o l o r )   r e s . a c o l o r = t e m p . a c o l o r ;  
             i f   ( t e m p . a c o l o r )   r e s . s c o l o r = t e m p . s c o l o r ;              
             r e t u r n   r e s ;  
       } ;  
 / * *      
 *           @ d e s c :   s e t   n o d e   c o l o r  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ p a r a m :   d e f a u l t C o l o r   -   n o d e   c o l o r  
 *           @ p a r a m :   s e l e c t e d C o l o r   -   s e l e c t e d   n o d e   c o l o r  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I t e m C o l o r = f u n c t i o n ( i t e m I d , d e f a u l t C o l o r , s e l e c t e d C o l o r )  
       {  
             i f   ( ( i t e m I d ) & & ( i t e m I d . s p a n ) )  
                   v a r   t e m p = i t e m I d ;  
             e l s e  
                   v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
                   e l s e   {  
                   i f   ( t e m p . i _ s e l )  
                         {     i f   ( s e l e c t e d C o l o r )   t e m p . s p a n . s t y l e . c o l o r = s e l e c t e d C o l o r ;   }  
                   e l s e  
                         {     i f   ( d e f a u l t C o l o r )   t e m p . s p a n . s t y l e . c o l o r = d e f a u l t C o l o r ;     }  
  
                   i f   ( s e l e c t e d C o l o r )   t e m p . s c o l o r = s e l e c t e d C o l o r ;  
                   i f   ( d e f a u l t C o l o r )   t e m p . a c o l o r = d e f a u l t C o l o r ;  
                   }  
       } ;  
  
 / * *  
 *           @ d e s c :   r e t u r n   i t e m   t e x t  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   t e x t   o f   i t e m   ( w i t h   H T M L   f o r m a t t i n g ,   i f   a n y )  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t I t e m T e x t = f u n c t i o n ( i t e m I d )  
       {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             r e t u r n ( t e m p . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 3 ] . c h i l d N o d e s [ 0 ] . i n n e r H T M L ) ;  
       } ;  
 / * *      
 *           @ d e s c :   r e t u r n   p a r e n t   i t e m   i d  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   i d   o f   p a r e n t   i t e m  
 *           @ t o p i c :   4  
 * /                    
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t P a r e n t I d = f u n c t i o n ( i t e m I d )  
       {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ( ! t e m p ) | | ( ! t e m p . p a r e n t O b j e c t ) )   r e t u r n   " " ;  
             r e t u r n   t e m p . p a r e n t O b j e c t . i d ;  
       } ;  
  
  
  
 / * *      
 *           @ d e s c :   c h a n g e   i t e m   i d  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   o l d   n o d e   i d  
 *           @ p a r a m :   n e w I t e m I d   -   n e w   n o d e   i d                  
 *           @ t o p i c :   4  
 * /          
       d h t m l X T r e e O b j e c t . p r o t o t y p e . c h a n g e I t e m I d = f u n c t i o n ( i t e m I d , n e w I t e m I d )  
       {  
       	 i f   ( i t e m I d = = n e w I t e m I d )   r e t u r n ;  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
                 t e m p . i d = n e w I t e m I d ;  
                 t e m p . s p a n . c o n t e x t M e n u I d = n e w I t e m I d ;  
                 t h i s . _ i d p u l l [ n e w I t e m I d ] = t h i s . _ i d p u l l [ i t e m I d ] ;  
                 d e l e t e   t h i s . _ i d p u l l [ i t e m I d ] ;  
       } ;  
  
  
 / * *  
 *           @ d e s c :   m a r k   s e l e c t e d   i t e m   a s   c u t t e d  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   2      
 * /          
       d h t m l X T r e e O b j e c t . p r o t o t y p e . d o C u t = f u n c t i o n ( ) {  
             i f   ( t h i s . n o d e C u t )   t h i s . c l e a r C u t ( ) ;  
             t h i s . n o d e C u t = ( n e w   A r r a y ( ) ) . c o n c a t ( t h i s . _ s e l e c t e d ) ;  
                 f o r   ( v a r   i = 0 ;   i < t h i s . n o d e C u t . l e n g t h ;   i + + ) {  
                     v a r   t e m p a = t h i s . n o d e C u t [ i ] ;  
                         t e m p a . _ c i m g s = n e w   A r r a y ( ) ;  
                     t e m p a . _ c i m g s [ 0 ] = t e m p a . i m a g e s [ 0 ] ;  
                     t e m p a . _ c i m g s [ 1 ] = t e m p a . i m a g e s [ 1 ] ;  
                     t e m p a . _ c i m g s [ 2 ] = t e m p a . i m a g e s [ 2 ] ;  
                     t e m p a . i m a g e s [ 0 ] = t e m p a . i m a g e s [ 1 ] = t e m p a . i m a g e s [ 2 ] = t h i s . c u t I m a g e ;  
                     t h i s . _ c o r r e c t P l u s ( t e m p a ) ;  
                 }  
       } ;  
  
 / * *  
 *           @ d e s c :   i n s e r t   p r e v i o u s l y   c u t t e d   b r a n c h  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n e w   p a r e n t   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   2      
 * /          
       d h t m l X T r e e O b j e c t . p r o t o t y p e . d o P a s t e = f u n c t i o n ( i t e m I d ) {  
             v a r   t o b j = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t o b j )   r e t u r n   0 ;  
                 f o r   ( v a r   i = 0 ;   i < t h i s . n o d e C u t . l e n g t h ;   i + + ) {  
                               i f   ( t h i s . _ c h e c k P N o d e s ( t o b j , t h i s . n o d e C u t [ i ] ) )   c o n t i n u e ;  
                                 t h i s . _ m o v e N o d e ( t h i s . n o d e C u t [ i ] , t o b j ) ;  
                               }  
             t h i s . c l e a r C u t ( ) ;  
       } ;  
  
 / * *      
 *           @ d e s c :   c l e a r   c u t  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   2      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . c l e a r C u t = f u n c t i o n ( ) {  
             f o r   ( v a r   i = 0 ;   i < t h i s . n o d e C u t . l e n g t h ;   i + + )  
                   {  
                     v a r   t e m p a = t h i s . n o d e C u t [ i ] ;  
                     t e m p a . i m a g e s [ 0 ] = t e m p a . _ c i m g s [ 0 ] ;  
                     t e m p a . i m a g e s [ 1 ] = t e m p a . _ c i m g s [ 1 ] ;  
                     t e m p a . i m a g e s [ 2 ] = t e m p a . _ c i m g s [ 2 ] ;  
                     t h i s . _ c o r r e c t P l u s ( t e m p a ) ;  
                   }  
                     t h i s . n o d e C u t = n e w   A r r a y ( ) ;  
       } ;  
        
  
  
       / * *      
 *           @ d e s c :   m o v e   n o d e   w i t h   s u b n o d e s  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   m o v e d   n o d e   o b j e c t  
 *           @ p a r a m :   t a r g e t O b j e c t   -   n e w   p a r e n t   n o d e  
 *           @ t o p i c :   2      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ m o v e N o d e = f u n c t i o n ( i t e m O b j e c t , t a r g e t O b j e c t ) {  
 
 	     r e t u r n   t h i s . _ m o v e N o d e T o ( i t e m O b j e c t , t a r g e t O b j e c t ) ;  
  
       }  
  
       / * *  
 *           @ d e s c :   f i x   o r d e r   o f   n o d e s   i n   c o l l e c t i o n  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   t a r g e t   -   p a r e n t   i t e m   n o d e  
 *           @ p a r a m :   z P a r e n t   -   b e f o r e   n o d e  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   2  
 * /  
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ f i x N o d e s C o l l e c t i o n = f u n c t i o n ( t a r g e t , z P a r e n t ) {  
             v a r   f l a g = 0 ;   v a r   i c o u n t = 0 ;  
             v a r   N o d e s = t a r g e t . c h i l d N o d e s ;  
             v a r   C o u n t = t a r g e t . c h i l d s C o u n t - 1 ;  
  
             i f   ( z P a r e n t = = N o d e s [ C o u n t ] )   r e t u r n ;  
             f o r   ( v a r   i = 0 ;   i < C o u n t ;   i + + )  
                   i f   ( N o d e s [ i ] = = N o d e s [ C o u n t ] )   {     N o d e s [ i ] = N o d e s [ i + 1 ] ;   N o d e s [ i + 1 ] = N o d e s [ C o u n t ] ;   }  
  
 / /                   C o u n t = t a r g e t . c h i l d s C o u n t ;  
             f o r   ( v a r   i = 0 ;   i < C o u n t + 1 ;   i + + )              
                   {  
                   i f   ( f l a g )   {    
                         v a r   t e m p = N o d e s [ i ] ;  
                         N o d e s [ i ] = f l a g ;    
                         f l a g = t e m p ;    
                               }  
                   e l s e    
                   i f   ( N o d e s [ i ] = = z P a r e n t )   {       f l a g = N o d e s [ i ] ;   N o d e s [ i ] = N o d e s [ C o u n t ] ;     }  
                   }  
       } ;  
        
 / * *      
 *           @ d e s c :   r e c r e a t e   b r a n c h  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   m o v e d   n o d e   o b j e c t  
 *           @ p a r a m :   t a r g e t O b j e c t   -   n e w   p a r e n t   n o d e  
 *           @ p a r a m :   l e v e l   -   t o p   l e v e l   f l a g  
 *           @ p a r a m :   b e f o r e N o d e   -   n o d e   f o r   s i b l i n g   m o d e  
 *           @ m o d e :   m o d e   -   D r a g A n d D r o p   m o d e   ( 0   -   a s   c h i l d ,   1   a s   s i b l i n g )  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   2  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ r e c r e a t e B r a n c h = f u n c t i o n ( i t e m O b j e c t , t a r g e t O b j e c t , b e f o r e N o d e , l e v e l ) {  
         v a r   i ;   v a r   s t = " " ;  
         i f   ( b e f o r e N o d e ) {  
         f o r   ( i = 0 ;   i < t a r g e t O b j e c t . c h i l d s C o u n t ;   i + + )  
                 i f   ( t a r g e t O b j e c t . c h i l d N o d e s [ i ] = = b e f o r e N o d e )   b r e a k ;  
  
         i f   ( i ! = 0 )  
                 b e f o r e N o d e = t a r g e t O b j e c t . c h i l d N o d e s [ i - 1 ] ;  
         e l s e {  
                 s t = " T O P " ;  
                 b e f o r e N o d e = " " ;  
                 }  
         }  
  
       v a r   t 2 = t h i s . _ o n r a d h ;   t h i s . _ o n r a d h = n u l l ;  
       v a r   n e w N o d e = t h i s . _ a t t a c h C h i l d N o d e ( t a r g e t O b j e c t , i t e m O b j e c t . i d , i t e m O b j e c t . l a b e l , 0 , i t e m O b j e c t . i m a g e s [ 0 ] , i t e m O b j e c t . i m a g e s [ 1 ] , i t e m O b j e c t . i m a g e s [ 2 ] , s t , 0 , b e f o r e N o d e ) ;  
  
       / / c o p y   u s e r   d a t a  
       n e w N o d e . _ u s e r d a t a l i s t = i t e m O b j e c t . _ u s e r d a t a l i s t ;  
       n e w N o d e . u s e r D a t a = i t e m O b j e c t . u s e r D a t a . c l o n e ( ) ;  
       n e w N o d e . X M L l o a d = i t e m O b j e c t . X M L l o a d ;  
       i f   ( t 2 ) {  
       	 t h i s . _ o n r a d h = t 2 ;   t h i s . _ o n r a d h ( n e w N o d e . i d ) ;   }  
  
 
       f o r   ( v a r   i = 0 ;   i < i t e m O b j e c t . c h i l d s C o u n t ;   i + + )  
             t h i s . _ r e c r e a t e B r a n c h ( i t e m O b j e c t . c h i l d N o d e s [ i ] , n e w N o d e , 0 , 1 ) ;  
  
 
       r e t u r n   n e w N o d e ;  
 }  
  
 / * *  
 *           @ d e s c :   m o v e   s i n g l e   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   m o v e d   n o d e   o b j e c t  
 *           @ p a r a m :   t a r g e t O b j e c t   -   n e w   p a r e n t   n o d e  
 *           @ m o d e :   m o d e   -   D r a g A n d D r o p   m o d e   ( 0   -   a s   c h i l d ,   1   a s   s i b l i n g )  
 *           @ t o p i c :   2  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ m o v e N o d e T o = f u n c t i o n ( i t e m O b j e c t , t a r g e t O b j e c t , b e f o r e N o d e ) {  
         / / r e t u r n ;  
         i f       ( i t e m O b j e c t . t r e e N o d . _ n o n T r i v i a l N o d e )  
                 r e t u r n   i t e m O b j e c t . t r e e N o d . _ n o n T r i v i a l N o d e ( t h i s , t a r g e t O b j e c t , b e f o r e N o d e , i t e m O b j e c t ) ;  
  
         i f         ( t a r g e t O b j e c t . m y t y p e )  
               v a r   f r a m e s M o v e = ( i t e m O b j e c t . t r e e N o d . l W i n ! = t a r g e t O b j e c t . l W i n ) ;  
         e l s e  
                     v a r   f r a m e s M o v e = ( i t e m O b j e c t . t r e e N o d . l W i n ! = t a r g e t O b j e c t . t r e e N o d . l W i n ) ;  
  
       i f   ( ! t h i s . c a l l E v e n t ( " o n D r a g " , [ i t e m O b j e c t . i d , t a r g e t O b j e c t . i d , ( b e f o r e N o d e ? b e f o r e N o d e . i d : n u l l ) , i t e m O b j e c t . t r e e N o d , t a r g e t O b j e c t . t r e e N o d ] ) )   r e t u r n   f a l s e ;  
             i f   ( ( t a r g e t O b j e c t . X M L l o a d = = 0 ) & & ( t h i s . X M L s o u r c e ) )  
                   {  
                   t a r g e t O b j e c t . X M L l o a d = 1 ;  
                         t h i s . _ l o a d D y n X M L ( t a r g e t O b j e c t . i d ) ;  
                   }  
             t h i s . o p e n I t e m ( t a r g e t O b j e c t . i d ) ;  
  
       v a r   o l d T r e e = i t e m O b j e c t . t r e e N o d ;  
       v a r   c = i t e m O b j e c t . p a r e n t O b j e c t . c h i l d s C o u n t ;  
       v a r   z = i t e m O b j e c t . p a r e n t O b j e c t ;  
  
       i f   ( ( f r a m e s M o v e ) | | ( o l d T r e e . d p c p y ) )   { / / i n t e r f r a m e   d r a g   f l a g  
                 v a r   _ o t i i d = i t e m O b j e c t . i d ;  
             i t e m O b j e c t = t h i s . _ r e c r e a t e B r a n c h ( i t e m O b j e c t , t a r g e t O b j e c t , b e f o r e N o d e ) ;  
                 i f   ( ! o l d T r e e . d p c p y )   o l d T r e e . d e l e t e I t e m ( _ o t i i d ) ;  
                 }  
       e l s e  
             {  
 	  
             v a r   C o u n t = t a r g e t O b j e c t . c h i l d s C o u n t ;   v a r   N o d e s = t a r g e t O b j e c t . c h i l d N o d e s ;  
             	 	 o l d T r e e . _ u n s e l e c t I t e m ( i t e m O b j e c t ) ;  
                       N o d e s [ C o u n t ] = i t e m O b j e c t ;  
                         i t e m O b j e c t . t r e e N o d = t a r g e t O b j e c t . t r e e N o d ;  
                         t a r g e t O b j e c t . c h i l d s C o u n t + + ;                    
 	 	 	  
                         v a r   t r = t h i s . _ d r a w N e w T r ( N o d e s [ C o u n t ] . h t m l N o d e ) ;  
  
                         i f   ( ! b e f o r e N o d e )  
                               {  
                                     t a r g e t O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . a p p e n d C h i l d ( t r ) ;  
                               i f   ( t h i s . d a d m o d e = = 1 )   t h i s . _ f i x N o d e s C o l l e c t i o n ( t a r g e t O b j e c t , b e f o r e N o d e ) ;  
                               }  
                         e l s e  
                               {  
                               t a r g e t O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . i n s e r t B e f o r e ( t r , b e f o r e N o d e . t r ) ;  
                               t h i s . _ f i x N o d e s C o l l e c t i o n ( t a r g e t O b j e c t , b e f o r e N o d e ) ;  
                               N o d e s = t a r g e t O b j e c t . c h i l d N o d e s ;  
                               }  
  
  
                   }  
  
                         i f   ( ( ! o l d T r e e . d p c p y ) & & ( ! f r a m e s M o v e ) )       {  
                                 v a r   z i r = i t e m O b j e c t . t r ;  
  
                                 i f   ( ( d o c u m e n t . a l l ) & & ( n a v i g a t o r . a p p V e r s i o n . s e a r c h ( / M S I E \   5 \ . 0 / g i ) ! = - 1 ) )  
                                         {  
                                         w i n d o w . s e t T i m e o u t ( f u n c t i o n ( )   {   z i r . p a r e n t N o d e . r e m o v e C h i l d ( z i r ) ;   }   ,   2 5 0   ) ;  
                                         }  
                                 e l s e       / / i f   ( z i r . p a r e n t N o d e )   z i r . p a r e n t N o d e . r e m o v e C h i l d ( z i r , t r u e ) ;  
  
                                 i t e m O b j e c t . p a r e n t O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . r e m o v e C h i l d ( i t e m O b j e c t . t r ) ;  
  
                                 / / i t e m O b j e c t . t r . r e m o v e N o d e ( t r u e ) ;  
                         i f   ( ( ! b e f o r e N o d e ) | | ( t a r g e t O b j e c t ! = i t e m O b j e c t . p a r e n t O b j e c t ) ) {  
                               f o r   ( v a r   i = 0 ;   i < z . c h i l d s C o u n t ;   i + + ) {  
                                     i f   ( z . c h i l d N o d e s [ i ] . i d = = i t e m O b j e c t . i d )   {  
                                     z . c h i l d N o d e s [ i ] = 0 ;  
                                     b r e a k ;                         } } }  
                               e l s e   z . c h i l d N o d e s [ z . c h i l d s C o u n t - 1 ] = 0 ;  
  
                         o l d T r e e . _ c o m p r e s s C h i l d L i s t ( z . c h i l d s C o u n t , z . c h i l d N o d e s ) ;  
                         z . c h i l d s C o u n t - - ;  
                         }  
  
  
             i f   ( ( ! f r a m e s M o v e ) & & ( ! o l d T r e e . d p c p y ) )   {  
               i t e m O b j e c t . t r = t r ;  
             t r . n o d e m = i t e m O b j e c t ;  
             i t e m O b j e c t . p a r e n t O b j e c t = t a r g e t O b j e c t ;  
  
             i f   ( o l d T r e e ! = t a r g e t O b j e c t . t r e e N o d )   {     i f ( i t e m O b j e c t . t r e e N o d . _ r e g i s t e r B r a n c h ( i t e m O b j e c t , o l d T r e e ) )   r e t u r n ;             t h i s . _ c l e a r S t y l e s ( i t e m O b j e c t ) ;     t h i s . _ r e d r a w F r o m ( t h i s , i t e m O b j e c t . p a r e n t O b j e c t ) ;       } ;  
  
             t h i s . _ c o r r e c t P l u s ( t a r g e t O b j e c t ) ;  
             t h i s . _ c o r r e c t L i n e ( t a r g e t O b j e c t ) ;  
  
             t h i s . _ c o r r e c t L i n e ( i t e m O b j e c t ) ;  
             t h i s . _ c o r r e c t P l u s ( i t e m O b j e c t ) ;  
  
                   / / f i x   t a r g e t   s i b l i n g s  
             i f   ( b e f o r e N o d e )  
             {  
  
                   t h i s . _ c o r r e c t P l u s ( b e f o r e N o d e ) ;  
                   / / t h i s . _ c o r r e c t L i n e ( b e f o r e N o d e ) ;  
             }  
             e l s e    
             i f   ( t a r g e t O b j e c t . c h i l d s C o u n t > = 2 )  
             {  
  
                   t h i s . _ c o r r e c t P l u s ( N o d e s [ t a r g e t O b j e c t . c h i l d s C o u n t - 2 ] ) ;  
                   t h i s . _ c o r r e c t L i n e ( N o d e s [ t a r g e t O b j e c t . c h i l d s C o u n t - 2 ] ) ;  
             }  
              
             t h i s . _ c o r r e c t P l u s ( N o d e s [ t a r g e t O b j e c t . c h i l d s C o u n t - 1 ] ) ;  
             / / t h i s . _ c o r r e c t L i n e ( N o d e s [ t a r g e t O b j e c t . c h i l d s C o u n t - 1 ] ) ;  
  
  
             i f   ( t h i s . t s c h e c k )   t h i s . _ c o r r e c t C h e c k S t a t e s ( t a r g e t O b j e c t ) ;  
             i f   ( o l d T r e e . t s c h e c k )   o l d T r e e . _ c o r r e c t C h e c k S t a t e s ( z ) ;  
  
             }  
  
             / / f i x   s o u r c e   p a r e n t  
  
             i f   ( c > 1 )   {   o l d T r e e . _ c o r r e c t P l u s ( z . c h i l d N o d e s [ c - 2 ] ) ;  
                               o l d T r e e . _ c o r r e c t L i n e ( z . c h i l d N o d e s [ c - 2 ] ) ;  
                               }  
  
  
 / /             i f   ( z . c h i l d s C o u n t = = 0 )  
                     o l d T r e e . _ c o r r e c t P l u s ( z ) ;  
                         o l d T r e e . _ c o r r e c t L i n e ( z ) ;  
  
 
             t h i s . c a l l E v e n t ( " o n D r o p " , [ i t e m O b j e c t . i d , t a r g e t O b j e c t . i d , ( b e f o r e N o d e ? b e f o r e N o d e . i d : n u l l ) , o l d T r e e , t a r g e t O b j e c t . t r e e N o d ] ) ;  
             r e t u r n   i t e m O b j e c t . i d ;  
       } ;  
  
        
  
 / * *  
 *           @ d e s c :   r e c u r s i v e   s e t   d e f a u l t   s t y l e s   f o r   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   t a r g e t   n o d e   o b j e c t  
 *           @ t o p i c :   6      
 * /        
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c l e a r S t y l e s = f u n c t i o n ( i t e m O b j e c t ) {  
                   v a r   t d 1 = i t e m O b j e c t . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 1 ] ;  
                   v a r   t d 3 = t d 1 . n e x t S i b l i n g . n e x t S i b l i n g ;  
  
                   i t e m O b j e c t . s p a n . i n n e r H T M L = i t e m O b j e c t . l a b e l ;  
 	 	   i t e m O b j e c t . i _ s e l = f a l s e ;  
  
       	 	   i f   ( i t e m O b j e c t . _ a i m g s )  
 	                   t h i s . d r a g g e r . r e m o v e D r a g g a b l e I t e m ( t d 1 . n e x t S i b l i n g ) ;  
  
                   i f   ( t h i s . c h e c k B o x O f f )   {  
 	 	   	 t d 1 . c h i l d N o d e s [ 0 ] . s t y l e . d i s p l a y = " " ;  
 	 	 	 t d 1 . c h i l d N o d e s [ 0 ] . o n c l i c k = t h i s . o n C h e c k B o x C l i c k ;  
 	 	 	 t h i s . _ s e t S r c ( t d 1 . c h i l d N o d e s [ 0 ] , t h i s . i m P a t h + t h i s . c h e c k A r r a y [ i t e m O b j e c t . c h e c k s t a t e ] ) ;  
 	 	 	 }  
                   e l s e   t d 1 . c h i l d N o d e s [ 0 ] . s t y l e . d i s p l a y = " n o n e " ;  
                   t d 1 . c h i l d N o d e s [ 0 ] . t r e e N o d = t h i s ;  
  
                   t h i s . d r a g g e r . r e m o v e D r a g g a b l e I t e m ( t d 3 ) ;  
                   i f   ( t h i s . d r a g A n d D r o p O f f )   t h i s . d r a g g e r . a d d D r a g g a b l e I t e m ( t d 3 , t h i s ) ;  
 	 	   i f   ( t h i s . _ a i m g s )   t h i s . d r a g g e r . a d d D r a g g a b l e I t e m ( t d 1 . n e x t S i b l i n g , t h i s ) ;  
 	 	   	 	    
                   t d 3 . c h i l d N o d e s [ 0 ] . c l a s s N a m e = " s t a n d a r t T r e e R o w " ;  
                   t d 3 . o n c l i c k = t h i s . o n R o w S e l e c t ;   t d 3 . o n d b l c l i c k = t h i s . o n R o w C l i c k 2 ;  
                   t d 1 . p r e v i o u s S i b l i n g . o n c l i c k = t h i s . o n R o w C l i c k ;  
  
                   t h i s . _ c o r r e c t L i n e ( i t e m O b j e c t ) ;  
                   t h i s . _ c o r r e c t P l u s ( i t e m O b j e c t ) ;  
                   f o r   ( v a r   i = 0 ;   i < i t e m O b j e c t . c h i l d s C o u n t ;   i + + )   t h i s . _ c l e a r S t y l e s ( i t e m O b j e c t . c h i l d N o d e s [ i ] ) ;    
  
       } ;  
 / * *  
 *           @ d e s c :   r e g i s t e r   n o d e   a n d   a l l   c h i l d s   n o d e s  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   n o d e   o b j e c t  
 *           @ t o p i c :   2      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ r e g i s t e r B r a n c h = f u n c t i o n ( i t e m O b j e c t , o l d T r e e ) {  
             i f   ( o l d T r e e )   o l d T r e e . _ g l o b a l I d S t o r a g e S u b ( i t e m O b j e c t . i d ) ;  
             i t e m O b j e c t . i d = t h i s . _ g l o b a l I d S t o r a g e A d d ( i t e m O b j e c t . i d , i t e m O b j e c t ) ;  
             i t e m O b j e c t . t r e e N o d = t h i s ;  
                   f o r   ( v a r   i = 0 ;   i < i t e m O b j e c t . c h i l d s C o u n t ;   i + + )  
                         t h i s . _ r e g i s t e r B r a n c h ( i t e m O b j e c t . c h i l d N o d e s [ i ] , o l d T r e e ) ;  
             r e t u r n   0 ;  
       } ;  
  
        
 / * *      
 *           @ d e s c :   e n a b l e   t h r e e   s t a t e   c h e c k b o x e s  
 *           @ b e f o r e I n i t :   1  
 *           @ p a r a m :   m o d e   -   1   -   o n ,   0   -   o f f ;  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e T h r e e S t a t e C h e c k b o x e s = f u n c t i o n ( m o d e )   {   t h i s . t s c h e c k = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;   } ;  
  
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   m o u s e   i s   o v e r   t r e e   n o d e  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :   o n M o u s e I n  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n M o u s e I n " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   m o u s e   h o v e r e d   o v e r   i t e m  
 *           @ e v e n t p a r a m :     I D   o f   i t e m  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n M o u s e I n H a n d l e r = f u n c t i o n ( f u n c ) {  
         	 t h i s . e h l t = t r u e ;  
       	 	 t h i s . a t t a c h E v e n t ( " o n M o u s e I n " , f u n c ) ;  
 	 } ;  
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   m o u s e   i s   o u t   o f   t r e e   n o d e  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :   o n M o u s e O u t  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n M o u s e O u t " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   i m m i d e a t l y   a f t e r   m o u s e   m o v e d   o u t   o f   i t e m  
 *           @ e v e n t p a r a m :     I D   o f   c l i c k e d   i t e m  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n M o u s e O u t H a n d l e r = f u n c t i o n ( f u n c ) {  
 	 	 t h i s . e h l t = t r u e ;  
       	 	 t h i s . a t t a c h E v e n t ( " o n M o u s e O u t " , f u n c ) ;  
 	 } ;  
  
  
  
  
  
 
  
  
  
 / * *  
 *           @ d e s c :   e n a b l e   t r e e   i m a g e s  
 *           @ b e f o r e I n i t :   1  
 *           @ p a r a m :   m o d e   -   1   -   o n ,   0   -   o f f ;  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0      
 * /                    
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e T r e e I m a g e s = f u n c t i o n ( m o d e )   {   t h i s . t i m g e n = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;   } ;  
        
  
        
 / * *  
 *           @ d e s c :   e n a b l e   m o d e   w i t h   f i x e d   t a b l e s   ( l o o k   b e t t e r ,   b u t   h a s n ' t   h o r i s o n t a l   s c r o l l b a r )  
 *           @ b e f o r e I n i t :   1  
 *           @ p a r a m :   m o d e   -   1   -   o n ,   0   -   o f f ;  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e F i x e d M o d e = f u n c t i o n ( m o d e )   {   t h i s . h f M o d e = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;   } ;  
        
 / * *      
 *           @ d e s c :   h i d e   c h e c k b o x e s   ( a l l   c h e c k b o x e s   i n   t r e e )  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   m o d e   -   e n a b l e d / d i s a b l e d  
 *           @ p a r a m :   h i d d e n   -   i f   s e t   t o   t r u e ,   c h e c k b o x e s   n o t   r e n d e r e d   b u t   c a n   b e   s h o w n   b y   s h o w I t e m C h e c k b o x  
 *           @ t o p i c :   0      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e C h e c k B o x e s = f u n c t i o n ( m o d e ,   h i d d e n ) {   t h i s . c h e c k B o x O f f = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;   t h i s . c B R O f = ( ! ( t h i s . c h e c k B o x O f f | | c o n v e r t S t r i n g T o B o o l e a n ( h i d d e n ) ) ) ;    
       	 } ;  
 / * *  
 *           @ d e s c :   s e t   d e f a u l t   i m a g e s   f o r   n o d e s   ( m u s t   b e   c a l l e d   b e f o r e   X M L   l o a d i n g )  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   a 0   -   i m a g e   f o r   n o d e   w i t h o u t   c h i l d r e n s ;  
 *           @ p a r a m :   a 1   -   i m a g e   f o r   c l o s e d   n o d e ;  
 *           @ p a r a m :   a 2   -   i m a g e   f o r   o p e n e d   n o d e                                      
 *           @ t o p i c :   6      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t S t d I m a g e s = f u n c t i o n ( i m a g e 1 , i m a g e 2 , i m a g e 3 ) {  
                                     t h i s . i m a g e A r r a y [ 0 ] = i m a g e 1 ;   t h i s . i m a g e A r r a y [ 1 ] = i m a g e 2 ;   t h i s . i m a g e A r r a y [ 2 ] = i m a g e 3 ; } ;  
  
 / * *  
 *           @ d e s c :   e n a b l e / d i s a b l e   t r e e   l i n e s   ( p a r e n t - c h i l d   t h r e a d s )  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   m o d e   -   e n a b l e / d i s a b l e   t r e e   l i n e s  
 *           @ t o p i c :   6  
 * /                                      
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e T r e e L i n e s = f u n c t i o n ( m o d e ) {  
             t h i s . t r e e L i n e s O n = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;  
       }  
  
 / * *  
 *           @ d e s c :   s e t   i m a g e s   u s e d   f o r   p a r e n t - c h i l d   t h r e a d s   d r a w i n g  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   a r r a y N a m e   -   n a m e   o f   a r r a y :   p l u s ,   m i n u s  
 *           @ p a r a m :   i m a g e 1   -   l i n e   c r o s s e d   i m a g e  
 *           @ p a r a m :   i m a g e 2   -   i m a g e   w i t h   t o p   l i n e  
 *           @ p a r a m :   i m a g e 3   -   i m a g e   w i t h   b o t t o m   l i n e  
 *           @ p a r a m :   i m a g e 4   -   i m a g e   w i t h o u t   l i n e  
 *           @ p a r a m :   i m a g e 5   -   s i n g l e   r o o t   i m a g e  
 *           @ t o p i c :   6  
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I m a g e A r r a y s = f u n c t i o n ( a r r a y N a m e , i m a g e 1 , i m a g e 2 , i m a g e 3 , i m a g e 4 , i m a g e 5 ) {  
             s w i t c h ( a r r a y N a m e ) {  
             c a s e   " p l u s " :   t h i s . p l u s A r r a y [ 0 ] = i m a g e 1 ;   t h i s . p l u s A r r a y [ 1 ] = i m a g e 2 ;   t h i s . p l u s A r r a y [ 2 ] = i m a g e 3 ;   t h i s . p l u s A r r a y [ 3 ] = i m a g e 4 ;   t h i s . p l u s A r r a y [ 4 ] = i m a g e 5 ;   b r e a k ;  
             c a s e   " m i n u s " :   t h i s . m i n u s A r r a y [ 0 ] = i m a g e 1 ;   t h i s . m i n u s A r r a y [ 1 ] = i m a g e 2 ;   t h i s . m i n u s A r r a y [ 2 ] = i m a g e 3 ;   t h i s . m i n u s A r r a y [ 3 ] = i m a g e 4 ;     t h i s . m i n u s A r r a y [ 4 ] = i m a g e 5 ;   b r e a k ;  
             }  
       } ;  
  
 / * *      
 *           @ d e s c :   e x p a n d   n o d e  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   4  
 * /    
       d h t m l X T r e e O b j e c t . p r o t o t y p e . o p e n I t e m = f u n c t i o n ( i t e m I d ) {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             e l s e   r e t u r n   t h i s . _ o p e n I t e m ( t e m p ) ;  
       } ;  
  
 / * *      
 *           @ d e s c :   e x p a n d   n o d e  
 *           @ p a r a m :   i t e m   -   t r e e   n o d e   o b j e c t  
 *           @ t y p e :   p r i v a t e  
 *           @ e d i t i n g :   p r o  
 *           @ t o p i c :   4      
 * /    
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ o p e n I t e m = f u n c t i o n ( i t e m ) {    
       	 	       v a r   s t a t e = t h i s . _ g e t O p e n S t a t e ( i t e m ) ;  
 	 	       i f   ( ( s t a t e < 0 ) | | ( ( ( t h i s . X M L s o u r c e ) & & ( ! i t e m . X M L l o a d ) ) ) ) {  
 	                       i f         ( ! t h i s . c a l l E v e n t ( " o n O p e n S t a r t " , [ i t e m . i d , s t a t e ] ) )   r e t u r n   0 ;  
 	                       t h i s . _ H i d e S h o w ( i t e m , 2 ) ;  
 	                         / / # o n _ o p e n _ e n d _ e v e n t : 1 1 0 5 2 0 0 6 {  
 	 	 	 	       i f         ( t h i s . c h e c k E v e n t ( " o n O p e n E n d " ) ) {    
 	 	 	 	 	 	       i f   ( t h i s . o n X L E = = t h i s . _ e p n F H e )   t h i s . _ e p n F H e ( t h i s , i t e m . i d , t r u e ) ;  
 	                                               i f   ( ! t h i s . x m l s t a t e )  
 	                                               	 	 t h i s . c a l l E v e n t ( " o n O p e n E n d " , [ i t e m . i d , t h i s . _ g e t O p e n S t a t e ( i t e m ) ] ) ;  
 	                                                 e l s e {  
 	                                                         t h a t . _ o i e _ o n X L E . p u s h ( t h a t . o n X L E ) ;  
 	                                                         t h i s . o n X L E = t h i s . _ e p n F H e ;  
 	                                                         }  
 	 	 	 	 	 	 	 }  
 	                         / / # }  
 	 	       }  
                       i f   ( i t e m . p a r e n t O b j e c t )   t h i s . _ o p e n I t e m ( i t e m . p a r e n t O b j e c t ) ;  
       } ;  
        
 / * *      
 *           @ d e s c :   c o l l a p s e   n o d e  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   4      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . c l o s e I t e m = f u n c t i o n ( i t e m I d ) {  
             i f   ( t h i s . r o o t I d = = i t e m I d )   r e t u r n   0 ;  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
                   i f   ( t e m p . c l o s e b l e )  
                         t h i s . _ H i d e S h o w ( t e m p , 1 ) ;  
       } ;  
        
        
  
        
        
        
        
        
  
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
              
 / * *  
 *           @ d e s c :   r e t u r n   n o d e   l e v e l   ( p o s i t i o n   i n   h i e r a r c h y )  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   n o d e   l e v e l  
 *           @ t o p i c :   4  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t L e v e l = f u n c t i o n ( i t e m I d ) {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             r e t u r n   t h i s . _ g e t N o d e L e v e l ( t e m p , 0 ) ;  
       } ;  
        
              
  
 / * *      
 *           @ d e s c :   p r e v e n t   n o d e   f r o m   c l o s i n g  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ p a r a m :   f l a g   -     i f   0   -   n o d e   c a n ' t   b e   c l o s e d ,   e l s e   n o d e   c a n   b e   c l o s e d  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   4      
 * /    
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I t e m C l o s e a b l e = f u n c t i o n ( i t e m I d , f l a g )  
       {  
             f l a g = c o n v e r t S t r i n g T o B o o l e a n ( f l a g ) ;  
             i f   ( ( i t e m I d ) & & ( i t e m I d . s p a n ) )    
                   v a r   t e m p = i t e m I d ;  
             e l s e              
                   v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
                   t e m p . c l o s e b l e = f l a g ;  
       } ;  
  
       / * *      
 *           @ d e s c :   r e c u r s i v e   f u n c t i o n   u s e d   f o   n o d e   l e v e l   c a l c u l a t i o n  
 *           @ p a r a m :   i t e m O b j e c t   -   p o i n t e r   t o   n o d e   o b j e c t  
 *           @ p a r a m :   c o u n t   -   c o u n t e r   o f   l e v e l s                  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   4      
 * /        
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t N o d e L e v e l = f u n c t i o n ( i t e m O b j e c t , c o u n t ) {  
             i f   ( i t e m O b j e c t . p a r e n t O b j e c t )   r e t u r n   t h i s . _ g e t N o d e L e v e l ( i t e m O b j e c t . p a r e n t O b j e c t , c o u n t + 1 ) ;  
             r e t u r n ( c o u n t ) ;  
       } ;  
        
       / * *      
 *           @ d e s c :   r e t u r n   n u m b e r   o f   c h i l d r e n s  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   c o u n t   o f   c h i l d   i t e m s ;   t r u e   -   f o r   n o t   l o a d e d   b r a n c h e s  
 *           @ t o p i c :   4  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . h a s C h i l d r e n = f u n c t i o n ( i t e m I d ) {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             e l s e    
                   {  
                         i f   (   ( t h i s . X M L s o u r c e ) & & ( ! t e m p . X M L l o a d )   )   r e t u r n   t r u e ;  
                         e l s e    
                               r e t u r n   t e m p . c h i l d s C o u n t ;  
                   } ;  
       } ;  
        
  
       / * *  
 *           @ d e s c :   r e t u r n   c o u n t   o f   l e a f s  
 *           @ p a r a m :   i t e m N o d e   -     n o d e   o b j e c t  
 *           @ t y p e :   p r i v a t e  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   4  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t L e a f C o u n t = f u n c t i o n ( i t e m N o d e ) {  
             v a r   a = 0 ;  
             f o r   ( v a r   b = 0 ;   b < i t e m N o d e . c h i l d s C o u n t ;   b + + )  
                   i f   ( i t e m N o d e . c h i l d N o d e s [ b ] . c h i l d s C o u n t = = 0 )   a + + ;  
             r e t u r n   a ;  
       }  
  
        
 / * *  
 *           @ d e s c :   s e t   n e w   n o d e   t e x t   ( H T M L   a l l o w e d )  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ p a r a m :   n e w L a b e l   -   n o d e   t e x t  
 *           @ p a r a m :   n e w T o o l t i p   -   ( o p t i o n a l ) t o o l t i p   f o r   t h e   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I t e m T e x t = f u n c t i o n ( i t e m I d , n e w L a b e l , n e w T o o l t i p )  
       {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             t e m p . l a b e l = n e w L a b e l ;  
             t e m p . s p a n . i n n e r H T M L = n e w L a b e l ;  
 
 	             t e m p . s p a n . p a r e n t N o d e . p a r e n t N o d e . t i t l e = n e w T o o l t i p | | " " ;  
       } ;  
  
 / * *  
 *           @ d e s c :   g e t   i t e m ' s   t o o l t i p  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   6  
 * /  
         d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t I t e m T o o l t i p = f u n c t i o n ( i t e m I d ) {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   " " ;  
 	     r e t u r n   ( t e m p . s p a n . p a r e n t N o d e . p a r e n t N o d e . _ d h x _ t i t l e | | t e m p . s p a n . p a r e n t N o d e . p a r e n t N o d e . t i t l e | | " " ) ;  
       } ;  
  
 / * *      
 *           @ d e s c :   r e f r e s h   t r e e   b r a n c h   f r o m   x m l   ( X M L   w i t h   d e s c r i p t i o n   o f   c h i l d   n o d e s   r e r e q u e s t e d   f r o m   s e r v e r )  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e ,   i f   n o t   d e f i n e d   t r e e   s u p e r   r o o t   u s e d .  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   6      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . r e f r e s h I t e m = f u n c t i o n ( i t e m I d ) {  
             i f   ( ! i t e m I d )   i t e m I d = t h i s . r o o t I d ;  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             t h i s . d e l e t e C h i l d I t e m s ( i t e m I d ) ;  
                 t h i s . _ l o a d D y n X M L ( i t e m I d ) ;  
       } ;  
  
       / * *      
 *           @ d e s c :   s e t   i t e m   i m a g e s  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ p a r a m :   i m a g e 1   -   n o d e   w i t h o u t   c h i l d r e n s   i m a g e  
 *           @ p a r a m :   i m a g e 2   -   c l o s e d   n o d e   i m a g e                      
 *           @ p a r a m :   i m a g e 3   -   o p e n   n o d e   i m a g e                    
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I t e m I m a g e 2 = f u n c t i o n ( i t e m I d ,   i m a g e 1 , i m a g e 2 , i m a g e 3 ) {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
                         t e m p . i m a g e s [ 1 ] = i m a g e 2 ;  
                         t e m p . i m a g e s [ 2 ] = i m a g e 3 ;  
                         t e m p . i m a g e s [ 0 ] = i m a g e 1 ;  
             t h i s . _ c o r r e c t P l u s ( t e m p ) ;  
       } ;  
 / * *  
 *           @ d e s c :   s e t   i t e m   i m a g e s  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ p a r a m :   i m a g e 1   -   n o d e   w i t h o u t   c h i l d r e n s   i m a g e   o r   c l o s e d   n o d e   i m a g e   ( i f   i m a g e 2   s p e c i f i e d )  
 *           @ p a r a m :   i m a g e 2   -   o p e n   n o d e   i m a g e   ( o p t i o n a l )                  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   6      
 * /        
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I t e m I m a g e = f u n c t i o n ( i t e m I d , i m a g e 1 , i m a g e 2 )  
       {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
                   i f   ( i m a g e 2 )  
                   {  
                         t e m p . i m a g e s [ 1 ] = i m a g e 1 ;  
                         t e m p . i m a g e s [ 2 ] = i m a g e 2 ;  
                   }  
                   e l s e   t e m p . i m a g e s [ 0 ] = i m a g e 1 ;  
             t h i s . _ c o r r e c t P l u s ( t e m p ) ;  
       } ;  
  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   t h e   n e x t   l e v e l   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   t h e   n e x t   l e v e l   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t S u b I t e m s   = f u n c t i o n ( i t e m I d )  
       {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d , 0 , 1 ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
 
             v a r   z = " " ;  
             f o r   ( i = 0 ;   i < t e m p . c h i l d s C o u n t ;   i + + ) {  
                   i f   ( ! z )   z = t e m p . c h i l d N o d e s [ i ] . i d ;  
                         e l s e   z + = t h i s . d l m t r + t e m p . c h i l d N o d e s [ i ] . i d ;  
  
                                                                                                                   }  
  
             r e t u r n   z ;  
       } ;  
  
  
  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   a l l   n e x t   l e v e l s   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t A l l S c r a g g y I t e m s   = f u n c t i o n ( n o d e )  
       {  
             v a r   z = " " ;  
             f o r   ( v a r   i = 0 ;   i < n o d e . c h i l d s C o u n t ;   i + + )  
                 {  
                         i f   ( ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d ) | | ( n o d e . c h i l d N o d e s [ i ] . c h i l d s C o u n t > 0 ) )  
                         {  
                                         i f   ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d )  
                                                 v a r   z b = t h i s . _ g e t A l l S c r a g g y I t e m s X M L ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d , 1 ) ;  
                                         e l s e  
                                               v a r   z b = t h i s . _ g e t A l l S c r a g g y I t e m s ( n o d e . c h i l d N o d e s [ i ] )  
  
                                   i f   ( z b )  
                                                 i f   ( z )   z + = t h i s . d l m t r + z b ;  
                                                 e l s e   z = z b ;  
                   }  
                         e l s e  
                               i f   ( ! z )   z = n o d e . c h i l d N o d e s [ i ] . i d ;  
                           e l s e   z + = t h i s . d l m t r + n o d e . c h i l d N o d e s [ i ] . i d ;  
                   }  
                     r e t u r n   z ;  
       } ;  
  
  
  
  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   a l l   n e x t   l e v e l s   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   6  
 * /  
  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t A l l F a t I t e m s   = f u n c t i o n ( n o d e )  
       {  
             v a r   z = " " ;  
             f o r   ( v a r   i = 0 ;   i < n o d e . c h i l d s C o u n t ;   i + + )  
                 {  
                         i f   ( ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d ) | | ( n o d e . c h i l d N o d e s [ i ] . c h i l d s C o u n t > 0 ) )  
                         {  
                           i f   ( ! z )   z = n o d e . c h i l d N o d e s [ i ] . i d ;  
                                 e l s e   z + = t h i s . d l m t r + n o d e . c h i l d N o d e s [ i ] . i d ;  
  
                                         i f   ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d )  
                                                 v a r   z b = t h i s . _ g e t A l l F a t I t e m s X M L ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d , 1 ) ;  
                                         e l s e  
                                               v a r   z b = t h i s . _ g e t A l l F a t I t e m s ( n o d e . c h i l d N o d e s [ i ] )  
  
                                   i f   ( z b )   z + = t h i s . d l m t r + z b ;  
                   }  
                   }  
                     r e t u r n   z ;  
       } ;  
  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   a l l   n e x t   l e v e l s   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t A l l S u b I t e m s   = f u n c t i o n ( i t e m I d , z , n o d e )  
       {  
             i f   ( n o d e )   t e m p = n o d e ;  
             e l s e   {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
                   } ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
  
             z = " " ;  
             f o r   ( v a r   i = 0 ;   i < t e m p . c h i l d s C o u n t ;   i + + )  
                   {  
                   i f   ( ! z )   z = t e m p . c h i l d N o d e s [ i ] . i d ;  
                         e l s e   z + = t h i s . d l m t r + t e m p . c h i l d N o d e s [ i ] . i d ;  
                   v a r   z b = t h i s . _ g e t A l l S u b I t e m s ( 0 , z , t e m p . c h i l d N o d e s [ i ] )  
  
                   i f   ( z b )   z + = t h i s . d l m t r + z b ;  
                   }  
  
 
                     r e t u r n   z ;  
       } ;  
  
  
  
  
        
 / * *      
 *           @ d e s c :   s e l e c t   n o d e   (   a n d   o p t i o n a l y   f i r e   o n s e l e c t   e v e n t )  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ p a r a m :   m o d e   -   I f   t r u e ,   s c r i p t   f u n c t i o n   f o r   s e l e c t e d   n o d e   w i l l   b e   c a l l e d .  
 *           @ p a r a m :   p r e s e r v e   -   p r e s e r v e   e a r l i e   s e l e c t e d   n o d e s  
 *           @ t o p i c :   1  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e l e c t I t e m = f u n c t i o n ( i t e m I d , m o d e , p r e s e r v e ) {  
             m o d e = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;  
                   v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ( ! t e m p ) | | ( ! t e m p . p a r e n t O b j e c t ) )   r e t u r n   0 ;  
  
                         i f   ( t h i s . X M L l o a d i n g W a r n i n g )  
                                 t e m p . p a r e n t O b j e c t . o p e n M e = 1 ;  
                         e l s e  
                           	 t h i s . _ o p e n I t e m ( t e m p . p a r e n t O b j e c t ) ;  
  
             / / t e m p . o n R o w S e l e c t ( 0 , t e m p . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 3 ] , m o d e ) ;  
                 v a r   z e = n u l l ;  
                 i f   ( p r e s e r v e )     {  
 	 	 	 z e = n e w   O b j e c t ;   z e . c t r l K e y = t r u e ;  
 	 	 	 i f   ( t e m p . i _ s e l )   z e . s k i p U n S e l = t r u e ;  
 	 	 }  
             i f   ( m o d e )  
                   t h i s . o n R o w S e l e c t ( z e , t e m p . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 3 ] , f a l s e ) ;  
             e l s e  
                   t h i s . o n R o w S e l e c t ( z e , t e m p . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 3 ] , t r u e ) ;  
       } ;  
        
 / * *  
 *           @ d e s c :   r e t u n   s e l e c t e d   n o d e   t e x t  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   t e x t   o f   s e l e c t e d   n o d e  
 *           @ t o p i c :   1  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t S e l e c t e d I t e m T e x t = f u n c t i o n ( )  
       {  
                 v a r   s t r = n e w   A r r a y ( ) ;  
                 f o r   ( v a r   i = 0 ;   i < t h i s . _ s e l e c t e d . l e n g t h ;   i + + )   s t r [ i ] = t h i s . _ s e l e c t e d [ i ] . s p a n . i n n e r H T M L ;  
             r e t u r n   ( s t r . j o i n ( t h i s . d l m t r ) ) ;  
       } ;  
  
  
  
  
 / * *      
 *           @ d e s c :   c o r r e c t   c h i l d N o d e   l i s t   a f t e r   n o d e   d e l e t i n g  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   C o u n t   -   c h i l d N o d e s   c o l l e c t i o n   l e n g t h                  
 *           @ p a r a m :   N o d e s   -   c h i l d N o d e s   c o l l e c t i o n  
 *           @ t o p i c :   4      
 * /        
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c o m p r e s s C h i l d L i s t = f u n c t i o n ( C o u n t , N o d e s )  
       {  
             C o u n t - - ;  
             f o r   ( v a r   i = 0 ;   i < C o u n t ;   i + + )  
             {  
                   i f   ( N o d e s [ i ] = = 0 )   {   N o d e s [ i ] = N o d e s [ i + 1 ] ;   N o d e s [ i + 1 ] = 0 ; }  
             } ;  
       } ;  
 / * *      
 *           @ d e s c :   d e l e t e   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m I d   -   t a r g e t   n o d e   i d  
 *           @ p a r a m :   h t m l O b j e c t   -   t a r g e t   n o d e   o b j e c t                  
 *           @ p a r a m :   s k i p   -   n o d e   u n r e g i s t r a t i o n   m o d e   ( o p t i o n a l ,   u s e d   b y   p r i v a t e   m e t h o d s )  
 *           @ t o p i c :   2  
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ d e l e t e N o d e = f u n c t i o n ( i t e m I d , h t m l O b j e c t , s k i p ) {  
       i f   ( ( ! h t m l O b j e c t ) | | ( ! h t m l O b j e c t . p a r e n t O b j e c t ) )   r e t u r n   0 ;  
       v a r   t e m p o s = 0 ;   v a r   t e m p o s 2 = 0 ;  
       i f   ( h t m l O b j e c t . t r . n e x t S i b l i n g )     t e m p o s = h t m l O b j e c t . t r . n e x t S i b l i n g . n o d e m ;  
       i f   ( h t m l O b j e c t . t r . p r e v i o u s S i b l i n g )     t e m p o s 2 = h t m l O b j e c t . t r . p r e v i o u s S i b l i n g . n o d e m ;  
        
             v a r   s N = h t m l O b j e c t . p a r e n t O b j e c t ;  
             v a r   C o u n t = s N . c h i l d s C o u n t ;  
             v a r   N o d e s = s N . c h i l d N o d e s ;  
                         f o r   ( v a r   i = 0 ;   i < C o u n t ;   i + + )  
                         {  
                               i f   ( N o d e s [ i ] . i d = = i t e m I d )   {    
                               i f   ( ! s k i p )   s N . h t m l N o d e . c h i l d N o d e s [ 0 ] . r e m o v e C h i l d ( N o d e s [ i ] . t r ) ;  
                               N o d e s [ i ] = 0 ;  
                               b r e a k ;  
                               }  
                         }  
             t h i s . _ c o m p r e s s C h i l d L i s t ( C o u n t , N o d e s ) ;  
             i f   ( ! s k i p )   {  
                 s N . c h i l d s C o u n t - - ;  
                                   }  
  
             i f   ( t e m p o s )   {  
             t h i s . _ c o r r e c t P l u s ( t e m p o s ) ;  
             t h i s . _ c o r r e c t L i n e ( t e m p o s ) ;  
                               }  
             i f   ( t e m p o s 2 )   {  
             t h i s . _ c o r r e c t P l u s ( t e m p o s 2 ) ;  
             t h i s . _ c o r r e c t L i n e ( t e m p o s 2 ) ;  
                               }  
             i f   ( t h i s . t s c h e c k )   t h i s . _ c o r r e c t C h e c k S t a t e s ( s N ) ;  
  
             i f   ( ! s k i p )   {  
                 t h i s . _ g l o b a l I d S t o r a g e R e c S u b ( h t m l O b j e c t ) ;  
                                   }  
       } ;  
 / * *  
 *           @ d e s c :   c h a n g e   s t a t e   o f   n o d e ' s   c h e c k b o x  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   t a r g e t   n o d e   i d  
 *           @ p a r a m :   s t a t e   -   c h e c k b o x   s t a t e   ( 0 / 1 / u n s u r e )  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t C h e c k = f u n c t i o n ( i t e m I d , s t a t e ) {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d , 0 , 1 ) ;  
             i f   ( ! s N o d e )   r e t u r n ;  
  
                 i f   ( s t a t e = = = " u n s u r e " )  
                         t h i s . _ s e t C h e c k ( s N o d e , s t a t e ) ;  
                 e l s e  
                 {  
             s t a t e = c o n v e r t S t r i n g T o B o o l e a n ( s t a t e ) ;  
                 i f   ( ( t h i s . t s c h e c k ) & & ( t h i s . s m c h e c k ) )   t h i s . _ s e t S u b C h e c k e d ( s t a t e , s N o d e ) ;  
             e l s e   t h i s . _ s e t C h e c k ( s N o d e , s t a t e ) ;  
                 }  
             i f   ( t h i s . s m c h e c k )  
                   t h i s . _ c o r r e c t C h e c k S t a t e s ( s N o d e . p a r e n t O b j e c t ) ;  
       } ;  
  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ s e t C h e c k = f u n c t i o n ( s N o d e , s t a t e ) {  
       	 	 i f   ( ! s N o d e )   r e t u r n ;  
                 i f   ( ( ( s N o d e . p a r e n t O b j e c t . _ r _ l o g i c ) | | ( t h i s . _ f r b t r ) ) & & ( s t a t e ) )  
 	 	 	 i f   ( t h i s . _ f r b t r s ) {  
 	 	 	 	 i f   ( t h i s . _ f r b t r L )       t h i s . _ s e t C h e c k ( t h i s . _ f r b t r L , 0 ) ;  
 	 	 	 	 t h i s . _ f r b t r L = s N o d e ;  
 	 	 	 }   e l s e  
         	                 f o r   ( v a r   i = 0 ;   i < s N o d e . p a r e n t O b j e c t . c h i l d s C o u n t ;   i + + )  
 	                                 t h i s . _ s e t C h e c k ( s N o d e . p a r e n t O b j e c t . c h i l d N o d e s [ i ] , 0 ) ;  
  
             v a r   z = s N o d e . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 1 ] . c h i l d N o d e s [ 0 ] ;  
  
             i f   ( s t a t e = = " u n s u r e " )   s N o d e . c h e c k s t a t e = 2 ;  
             e l s e   i f   ( s t a t e )   s N o d e . c h e c k s t a t e = 1 ;   e l s e   s N o d e . c h e c k s t a t e = 0 ;  
             i f   ( s N o d e . d s c h e c k )   s N o d e . c h e c k s t a t e = s N o d e . d s c h e c k ;  
             t h i s . _ s e t S r c ( z , t h i s . i m P a t h + ( ( s N o d e . p a r e n t O b j e c t . _ r _ l o g i c | | t h i s . _ f r b t r ) ? t h i s . r a d i o A r r a y : t h i s . c h e c k A r r a y ) [ s N o d e . c h e c k s t a t e ] ) ;  
       } ;  
  
 / * *  
 *           @ d e s c :   c h a n g e   s t a t e   o f   n o d e ' s   c h e c k b o x   a n d   a l l   c h i l d n o d e s   c h e c k b o x e s  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   t a r g e t   n o d e   i d  
 *           @ p a r a m :   s t a t e   -   c h e c k b o x   s t a t e  
 *           @ t o p i c :   5  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t S u b C h e c k e d = f u n c t i o n ( i t e m I d , s t a t e ) {  
       v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
       t h i s . _ s e t S u b C h e c k e d ( s t a t e , s N o d e ) ;  
       t h i s . _ c o r r e c t C h e c k S t a t e s ( s N o d e . p a r e n t O b j e c t ) ;  
 }  
  
  
  
 / * *      
 *           @ d e s c :   c h a n g e   s t a t e   o f   n o d e ' s   c h e c k b o x   a n d   a l l   c h i l d n o d e s   c h e c k b o x e s  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m I d   -   t a r g e t   n o d e   i d  
 *           @ p a r a m :   s t a t e   -   c h e c k b o x   s t a t e  
 *           @ p a r a m :   s N o d e   -   t a r g e t   n o d e   o b j e c t   ( o p t i o n a l ,   u s e d   b y   p r i v a t e   m e t h o d s )  
 *           @ t o p i c :   5      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ s e t S u b C h e c k e d = f u n c t i o n ( s t a t e , s N o d e ) {  
             s t a t e = c o n v e r t S t r i n g T o B o o l e a n ( s t a t e ) ;  
             i f   ( ! s N o d e )   r e t u r n ;  
                 i f   ( ( ( s N o d e . p a r e n t O b j e c t . _ r _ l o g i c ) | | ( t h i s . _ f r b t r ) ) & & ( s t a t e ) )  
                         f o r   ( v a r   i = 0 ;   i < s N o d e . p a r e n t O b j e c t . c h i l d s C o u n t ;   i + + )  
                                 t h i s . _ s e t S u b C h e c k e d ( 0 , s N o d e . p a r e n t O b j e c t . c h i l d N o d e s [ i ] ) ;  
  
 
                 i f   ( s N o d e . _ r _ l o g i c | | t h i s . _ f r b t r )  
                       t h i s . _ s e t S u b C h e c k e d ( s t a t e , s N o d e . c h i l d N o d e s [ 0 ] ) ;  
                 e l s e  
             f o r   ( v a r   i = 0 ;   i < s N o d e . c h i l d s C o u n t ;   i + + )  
                   {  
                           t h i s . _ s e t S u b C h e c k e d ( s t a t e , s N o d e . c h i l d N o d e s [ i ] ) ;  
                   } ;  
             v a r   z = s N o d e . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 1 ] . c h i l d N o d e s [ 0 ] ;  
  
             i f   ( s t a t e )   s N o d e . c h e c k s t a t e = 1 ;  
             e l s e         s N o d e . c h e c k s t a t e = 0 ;  
             i f   ( s N o d e . d s c h e c k )     s N o d e . c h e c k s t a t e = s N o d e . d s c h e c k ;  
  
  
  
             t h i s . _ s e t S r c ( z , t h i s . i m P a t h + ( ( s N o d e . p a r e n t O b j e c t . _ r _ l o g i c | | t h i s . _ f r b t r ) ? t h i s . r a d i o A r r a y : t h i s . c h e c k A r r a y ) [ s N o d e . c h e c k s t a t e ] ) ;  
       } ;  
  
 / * *  
 *           @ d e s c :   r e t u r n   s t a t e   o f   n o d e s ' s   c h e c k b o x  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   t a r g e t   n o d e   i d  
 *           @ r e t u r n :   n o d e   s t a t e   ( 0   -   u n c h e c k e d , 1   -   c h e c k e d ,   2   -   t h i r d   s t a t e )  
 *           @ t o p i c :   5      
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . i s I t e m C h e c k e d = f u n c t i o n ( i t e m I d ) {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! s N o d e )   r e t u r n ;              
             r e t u r n       s N o d e . c h e c k s t a t e ;  
       } ;  
  
  
  
  
  
  
  
 / * *  
 *           @ d e s c :   d e l e t e   a l l   c h i l d r e n   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ t o p i c :   2  
 * /  
         d h t m l X T r e e O b j e c t . p r o t o t y p e . d e l e t e C h i l d I t e m s = f u n c t i o n ( i t e m I d )  
       {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! s N o d e )   r e t u r n ;  
             v a r   j = s N o d e . c h i l d s C o u n t ;  
             f o r   ( v a r   i = 0 ;   i < j ;   i + + )  
             {  
                   t h i s . _ d e l e t e N o d e ( s N o d e . c h i l d N o d e s [ 0 ] . i d , s N o d e . c h i l d N o d e s [ 0 ] ) ;  
             } ;  
       } ;  
  
 / * *  
 *           @ d e s c :   d e l e t e   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ p a r a m :   s e l e c t P a r e n t   -   I f   t r u e   p a r e n t   o f   d e l e t e d   i t e m   g e t   s e l e c t i o n ,   e l s e   n o   s e l e c t e d   i t e m s   l e a v i n g   i n   t r e e .  
 *           @ t o p i c :   2      
 * /              
 d h t m l X T r e e O b j e c t . p r o t o t y p e . d e l e t e I t e m = f u n c t i o n ( i t e m I d , s e l e c t P a r e n t ) {  
         i f   ( ( ! t h i s . _ o n r d l h ) | | ( t h i s . _ o n r d l h ( i t e m I d ) ) ) {  
 	 	 v a r   z = t h i s . _ d e l e t e I t e m ( i t e m I d , s e l e c t P a r e n t ) ;  
 
 	 }  
  
         / / n b : s o l v e s   s t a n d a r d   d o c t y p e   p r b   i n   I E  
             t h i s . a l l T r e e . c h i l d N o d e s [ 0 ] . b o r d e r   =   " 1 " ;  
             t h i s . a l l T r e e . c h i l d N o d e s [ 0 ] . b o r d e r   =   " 0 " ;  
 }  
 / * *  
 *           @ d e s c :   d e l e t e   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i d   -   n o d e   i d  
 *           @ p a r a m :   s e l e c t P a r e n t   -   I f   t r u e   p a r e n t   o f   d e l e t e d   i t e m   g e t   s e l e c t i o n ,   e l s e   n o   s e l e c t e d   i t e m s   l e a v i n g   i n   t r e e .  
 *           @ p a r a m :   s k i p   -   u n r e g i s t e r i n g   m o d e   ( o p t i o n a l ,   u s e d   b y   p r i v a t e   m e t h o d s )                  
 *           @ t o p i c :   2      
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ d e l e t e I t e m = f u n c t i o n ( i t e m I d , s e l e c t P a r e n t , s k i p ) {  
             s e l e c t P a r e n t = c o n v e r t S t r i n g T o B o o l e a n ( s e l e c t P a r e n t ) ;  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! s N o d e )   r e t u r n ;  
                 v a r   p i d = t h i s . g e t P a r e n t I d ( i t e m I d ) ;  
  
             v a r   z T e m p = s N o d e . p a r e n t O b j e c t ;  
             t h i s . _ d e l e t e N o d e ( i t e m I d , s N o d e , s k i p ) ;  
             t h i s . _ c o r r e c t P l u s ( z T e m p ) ;  
             t h i s . _ c o r r e c t L i n e ( z T e m p ) ;  
  
             i f     ( ( s e l e c t P a r e n t ) & & ( p i d ! = t h i s . r o o t I d ) )   t h i s . s e l e c t I t e m ( p i d , 1 ) ;  
             r e t u r n         z T e m p ;  
       } ;  
  
 / * *  
 *           @ d e s c :   u r e g i s t e r   a l l   c h i l d   n o d e s   o f   t a r g e t   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m O b j e c t   -   n o d e   o b j e c t  
 *           @ t o p i c :   3      
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g l o b a l I d S t o r a g e R e c S u b = f u n c t i o n ( i t e m O b j e c t ) {  
             f o r ( v a r   i = 0 ;   i < i t e m O b j e c t . c h i l d s C o u n t ;   i + + )  
             {  
                   t h i s . _ g l o b a l I d S t o r a g e R e c S u b ( i t e m O b j e c t . c h i l d N o d e s [ i ] ) ;  
                   t h i s . _ g l o b a l I d S t o r a g e S u b ( i t e m O b j e c t . c h i l d N o d e s [ i ] . i d ) ;  
             } ;  
             t h i s . _ g l o b a l I d S t o r a g e S u b ( i t e m O b j e c t . i d ) ;  
  
             	     / * a n t i   m e m o r y   l e a k i n g * /  
 	     	 v a r   z = i t e m O b j e c t ;  
 / / 	 	 v a r   p a r = z . s p a n . p a r e n t N o d e . p a r e n t N o d e . c h i l d N o d e s ;  
 / / 	 	 p a r [ 0 ] . p a r e n t O b j e c t = n u l l ;  
 / / 	 	 p a r [ 1 ] . c h i l d N o d e s [ 0 ] . p a r e n t O b j e c t = n u l l ;  
 / / 	 	 p a r [ 2 ] . c h i l d N o d e s [ 0 ] . p a r e n t O b j e c t = n u l l ;  
 / / 	 	 p a r [ 2 ] . c h i l d N o d e s [ 0 ] . t r e e N o d = n u l l ;  
 / / 	 	 p a r [ 2 ] . p a r e n t O b j e c t = n u l l ;  
 / / 	 	 p a r [ 3 ] . p a r e n t O b j e c t = n u l l ;  
 	 	 z . s p a n = n u l l ;  
 	 	 z . t r . n o d e m = n u l l ;  
 	 	 z . t r = n u l l ;  
 	 	 z . h t m l N o d e = n u l l ;  
       } ;  
  
 / * *      
 *           @ d e s c :   c r e a t e   n e w   n o d e   n e x t   t o   s p e c i f i e d  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ p a r a m :   n e w I t e m I d   -   n e w   n o d e   i d  
 *           @ p a r a m :   i t e m T e x t   -   n e w   n o d e   t e x t  
 *           @ p a r a m :   i t e m A c t i o n H a n d l e r   -   f u n c t i o n   f i r e d   o n   n o d e   s e l e c t   e v e n t   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 1   -   i m a g e   f o r   n o d e   w i t h o u t   c h i l d r e n s ;   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 2   -   i m a g e   f o r   c l o s e d   n o d e ;   ( o p t i o n a l )  
 *           @ p a r a m :   i m a g e 3   -   i m a g e   f o r   o p e n e d   n o d e   ( o p t i o n a l )  
 *           @ p a r a m :   o p t i o n S t r   -   o p t i o n s   s t r i n g   ( o p t i o n a l )                          
 *           @ p a r a m :   c h i l d s   -   n o d e   c h i l d s   f l a g   ( f o r   d y n a m i c a l   t r e e s )   ( o p t i o n a l )  
 *           @ t o p i c :   2      
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . i n s e r t N e w N e x t = f u n c t i o n ( i t e m I d , n e w I t e m I d , i t e m T e x t , i t e m A c t i o n H a n d l e r , i m a g e 1 , i m a g e 2 , i m a g e 3 , o p t i o n S t r , c h i l d s ) {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ( ! s N o d e ) | | ( ! s N o d e . p a r e n t O b j e c t ) )   r e t u r n   ( 0 ) ;  
  
             v a r   n o d e z = t h i s . _ a t t a c h C h i l d N o d e ( 0 , n e w I t e m I d , i t e m T e x t , i t e m A c t i o n H a n d l e r , i m a g e 1 , i m a g e 2 , i m a g e 3 , o p t i o n S t r , c h i l d s , s N o d e ) ;  
 
                 r e t u r n   n o d e z ;  
       } ;  
  
  
        
 / * *  
 *           @ d e s c :   r e t u n   n o d e   i d   b y   i n d e x  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   p a r e n t   n o d e   i d  
 *           @ p a r a m :   i n d e x   -   i n d e x   o f   n o d e ,   0   b a s e d  
 *           @ r e t u r n :   n o d e   i d  
 *           @ t o p i c :   1  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t I t e m I d B y I n d e x = f u n c t i o n ( i t e m I d , i n d e x ) {  
               v a r   z = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
               i f   ( ( ! z ) | | ( i n d e x > z . c h i l d s C o u n t ) )   r e t u r n   n u l l ;  
                     r e t u r n   z . c h i l d N o d e s [ i n d e x ] . i d ;  
       } ;  
  
 / * *  
 *           @ d e s c :   r e t u n   c h i l d   n o d e   i d   b y   i n d e x  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   p a r e n t   n o d e   i d                  
 *           @ p a r a m :   i n d e x   -   i n d e x   o f   c h i l d   n o d e  
 *           @ r e t u r n :   n o d e   i d  
 *           @ t o p i c :   1  
 * /              
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t C h i l d I t e m I d B y I n d e x = f u n c t i o n ( i t e m I d , i n d e x ) {  
               v a r   z = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
               i f   ( ( ! z ) | | ( i n d e x > = z . c h i l d s C o u n t ) )   r e t u r n   n u l l ;  
                     r e t u r n   z . c h i l d N o d e s [ i n d e x ] . i d ;  
       } ;  
  
  
  
        
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   d r a g - a n d - d r o p   e v e n t   o c c u r e d  
 *           @ p a r a m :   a F u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0 , 7  
 *           @ e v e n t :         o n D r a g  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n D r a g " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   o c c u r e d   a f t e r   i t e m   w a s   d r a g g e d   a n d   d r o p e d   o n   a n o t h e r   i t e m ,   b u t   b e f o r e   i t e m   m o v i n g   p r o c e s s e d .  
             E v e n t   a l s o   r a i s e d   w h i l e   p r o g r a m m a t i c   m o v i n g   n o d e s .  
 *           @ e v e n t p a r a m :     I D   o f   s o u r c e   i t e m  
 *           @ e v e n t p a r a m :     I D   o f   t a r g e t   i t e m  
 *           @ e v e n t p a r a m :     i f   n o d e   d r o p e d   a s   s i b l i n g   t h e n   c o n t a i n   i d   o f   i t e m   b e f o r e   w h i t c h   s o u r c e   n o d e   w i l l   b e   i n s e r t e d  
 *           @ e v e n t p a r a m :     s o u r c e   T r e e   o b j e c t  
 *           @ e v e n t p a r a m :     t a r g e t   T r e e   o b j e c t  
 *           @ e v e n t r e t u r n :     t r u e   -   c o n f i r m   d r a g - a n d - d r o p ;   f a l s e   -   d e n y   d r a g - a n d - d r o p ;  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t D r a g H a n d l e r = f u n c t i o n ( f u n c ) {   t h i s . a t t a c h E v e n t ( " o n D r a g " , f u n c ) ;   } ;  
        
       / * *  
 *           @ d e s c :   c l e a r   s e l e c t i o n   f r o m   n o d e  
 *           @ p a r a m :   h t m l N o d e   -   p o i n t e r   t o   n o d e   o b j e c t  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   1  
 * /  
         d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c l e a r M o v e = f u n c t i o n ( ) {  
 	 	 i f   ( t h i s . _ l a s t M a r k ) {  
 	       	 	 t h i s . _ l a s t M a r k . c l a s s N a m e = t h i s . _ l a s t M a r k . c l a s s N a m e . r e p l a c e ( / d r a g A n d D r o p R o w / g , " " ) ;  
 	       	 	 t h i s . _ l a s t M a r k = n u l l ;  
 	 	 }  
 
 	 	 t h i s . a l l T r e e . c l a s s N a m e = t h i s . a l l T r e e . c l a s s N a m e . r e p l a c e ( "   s e l e c t i o n B o x " , " " ) ;  
       } ;  
  
       / * *      
 *           @ d e s c :   e n a b l e / d i s a b l e   d r a g - a n d - d r o p  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   m o d e   -   e n a b l e d / d i s a b l e d   [   c a n   b e   t r u e / f a l s e / t e m p o r a r y _ d i s a b l e d   -   l a s t   v a l u e   m e a n   t h a t   t r e e   c a n   b e   D - n - D   c a n   b e   s w i t c h e d   t o   t r u e   l a t e r   ]  
 *           @ p a r a m :   r m o d e   -   e n a b l e d / d i s a b l e d   d r a g   a n d   d r o p   o n   s u p e r   r o o t  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e D r a g A n d D r o p = f u n c t i o n ( m o d e , r m o d e ) {  
                 i f     ( m o d e = = " t e m p o r a r y _ d i s a b l e d " ) {  
                         t h i s . d A D T e m p O f f = f a l s e ;  
                         m o d e = t r u e ;                                     }  
                 e l s e  
                         t h i s . d A D T e m p O f f = t r u e ;  
  
             t h i s . d r a g A n d D r o p O f f = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;  
                   i f   ( t h i s . d r a g A n d D r o p O f f )   t h i s . d r a g g e r . a d d D r a g L a n d i n g ( t h i s . a l l T r e e , t h i s ) ;  
                 i f   ( a r g u m e n t s . l e n g t h > 1 )  
                         t h i s . _ d d r o n r = ( ! c o n v e r t S t r i n g T o B o o l e a n ( r m o d e ) ) ;  
               } ;        
  
 / * *  
 *           @ d e s c :   s e t   s e l e c t i o n   o n   n o d e  
 *           @ p a r a m :   n o d e   -   p o i n t e r   t o   n o d e   o b j e c t  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   1  
 * /          
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ s e t M o v e = f u n c t i o n ( h t m l N o d e , x , y ) {  
             i f   ( h t m l N o d e . p a r e n t O b j e c t . s p a n )   {  
             / / w i n d o w . s t a t u s = x ;  
             v a r   a 1 = g e t A b s o l u t e T o p ( h t m l N o d e ) ;  
             v a r   a 2 = g e t A b s o l u t e T o p ( t h i s . a l l T r e e ) ;  
  
             t h i s . d a d m o d e c = t h i s . d a d m o d e ; / / t h i s . d a d m o d e ;  
             t h i s . d a d m o d e f i x = 0 ;  
 
  
 	 	 	 v a r   z N = h t m l N o d e . p a r e n t O b j e c t . s p a n ;  
 	 	 	 z N . c l a s s N a m e + = "   d r a g A n d D r o p R o w " ;  
 	 	 	 t h i s . _ l a s t M a r k = z N ;  
 
             }  
       } ;  
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ a u t o S c r o l l = f u n c t i o n ( n o d e , a 1 , a 2 ) {  
                   i f   ( t h i s . a u t o S c r o l l )  
                   {  
 	 	   	 i f   ( n o d e ) {  
 	 	 	 	 a 1 = g e t A b s o l u t e T o p ( n o d e ) ;  
 	             	 	 a 2 = g e t A b s o l u t e T o p ( t h i s . a l l T r e e ) ;  
 	 	 	 }  
                         / / s c r o l l   d o w n  
                         i f   (   ( a 1 - a 2 - p a r s e I n t ( t h i s . a l l T r e e . s c r o l l T o p ) ) > ( p a r s e I n t ( t h i s . a l l T r e e . o f f s e t H e i g h t ) - 5 0 )   )  
                               t h i s . a l l T r e e . s c r o l l T o p = p a r s e I n t ( t h i s . a l l T r e e . s c r o l l T o p ) + 2 0 ;  
                         / / s c r o l l   t o p  
                         i f   (   ( a 1 - a 2 ) < ( p a r s e I n t ( t h i s . a l l T r e e . s c r o l l T o p ) + 3 0 )   )  
                               t h i s . a l l T r e e . s c r o l l T o p = p a r s e I n t ( t h i s . a l l T r e e . s c r o l l T o p ) - 2 0 ;  
                   }  
 }  
  
 / * *  
 *           @ d e s c :   c r e a t e   h t m l   e l e m e n t   f o r   d r a g g i n g  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   h t m l O b j e c t   -   h t m l   n o d e   o b j e c t  
 *           @ t o p i c :   1  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c r e a t e D r a g N o d e = f u n c t i o n ( h t m l O b j e c t , e ) {  
             i f   ( ! t h i s . d A D T e m p O f f )   r e t u r n   n u l l ;  
  
           v a r   o b j = h t m l O b j e c t . p a r e n t O b j e c t ;  
         i f   ( ! o b j . i _ s e l )  
                   t h i s . _ s e l e c t I t e m ( o b j , e ) ;  
  
 
             v a r   d r a g S p a n = d o c u m e n t . c r e a t e E l e m e n t ( ' d i v ' ) ;  
  
                         v a r   t e x t = n e w   A r r a y ( ) ;  
                         i f   ( t h i s . _ i t i m _ d g )  
                                         f o r   ( v a r   i = 0 ;   i < t h i s . _ s e l e c t e d . l e n g t h ;   i + + )  
                                                 t e x t [ i ] = " < t a b l e   c e l l s p a c i n g = ' 0 '   c e l l p a d d i n g = ' 0 ' > < t r > < t d > < i m g   w i d t h = ' 1 8 p x '   h e i g h t = ' 1 8 p x '   s r c = ' " + t h i s . _ g e t S r c ( t h i s . _ s e l e c t e d [ i ] . s p a n . p a r e n t N o d e . p r e v i o u s S i b l i n g . c h i l d N o d e s [ 0 ] ) + " ' > < / t d > < t d > " + t h i s . _ s e l e c t e d [ i ] . s p a n . i n n e r H T M L + " < / t d > < / t r > < t a b l e > " ;  
                         e l s e  
                                 t e x t = t h i s . g e t S e l e c t e d I t e m T e x t ( ) . s p l i t ( t h i s . d l m t r ) ;  
  
                         d r a g S p a n . i n n e r H T M L = t e x t . j o i n ( " " ) ;  
                   d r a g S p a n . s t y l e . p o s i t i o n = " a b s o l u t e " ;  
                   d r a g S p a n . c l a s s N a m e = " d r a g S p a n D i v " ;  
             t h i s . _ d r a g g e d = ( n e w   A r r a y ( ) ) . c o n c a t ( t h i s . _ s e l e c t e d ) ;  
           r e t u r n   d r a g S p a n ;  
 }  
  
  
  
 / * *      
 *           @ d e s c :   f o c u s   i t e m   i n   t r e e  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m   -   n o d e   o b j e c t  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   0      
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ f o c u s N o d e = f u n c t i o n ( i t e m ) {  
             v a r   z = g e t A b s o l u t e T o p ( i t e m . h t m l N o d e ) - g e t A b s o l u t e T o p ( t h i s . a l l T r e e ) ;  
             i f   ( ( z > ( t h i s . a l l T r e e . s c r o l l T o p + t h i s . a l l T r e e . o f f s e t H e i g h t - 3 0 ) ) | | ( z < t h i s . a l l T r e e . s c r o l l T o p ) )  
             t h i s . a l l T r e e . s c r o l l T o p = z ;  
       } ;  
  
  
  
  
                              
  
  
  
  
  
  
  
  
 / / / D r a g A n d D r o p  
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ p r e v e n t N s D r a g = f u n c t i o n ( e ) {  
       i f   ( ( e ) & & ( e . p r e v e n t D e f a u l t ) )   {   e . p r e v e n t D e f a u l t ( ) ;   r e t u r n   f a l s e ;   }  
       r e t u r n   f a l s e ;  
 }  
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ d r a g = f u n c t i o n ( s o u r c e H t m l O b j e c t , d h t m l O b j e c t , t a r g e t H t m l O b j e c t ) {  
  
             i f   ( t h i s . _ a u t o O p e n T i m e r )   c l e a r T i m e o u t ( t h i s . _ a u t o O p e n T i m e r ) ;  
  
             i f   ( ! t a r g e t H t m l O b j e c t . p a r e n t O b j e c t ) {  
                         t a r g e t H t m l O b j e c t = t h i s . h t m l N o d e . h t m l N o d e . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 0 ] . c h i l d N o d e s [ 1 ] . c h i l d N o d e s [ 0 ] ;  
                         t h i s . d a d m o d e c = 0 ;  
                         }  
  
             t h i s . _ c l e a r M o v e ( ) ;  
             v a r   z = s o u r c e H t m l O b j e c t . p a r e n t O b j e c t . t r e e N o d ;  
                 i f   ( ( z ) & & ( z . _ c l e a r M o v e ) )       z . _ c l e a r M o v e ( " " ) ;  
  
               i f   ( ( ! t h i s . d r a g M o v e ) | | ( t h i s . d r a g M o v e ( ) ) )  
                     {  
                             i f   ( ( ! z ) | | ( ! z . _ c l e a r M o v e ) | | ( ! z . _ d r a g g e d ) )   v a r   c o l = n e w   A r r a y ( s o u r c e H t m l O b j e c t . p a r e n t O b j e c t ) ;  
                             e l s e   v a r   c o l = z . _ d r a g g e d ;  
 	 	 	 	 v a r   t r g = t a r g e t H t m l O b j e c t . p a r e n t O b j e c t ;  
  
                                 f o r   ( v a r   i = 0 ;   i < c o l . l e n g t h ;   i + + ) {  
                                       v a r   n e w I D = t h i s . _ m o v e N o d e ( c o l [ i ] , t r g ) ;  
 	 	 	 	       i f   ( ( t h i s . d a d m o d e c ) & & ( n e w I D ! = = f a l s e ) )   t r g = t h i s . _ g l o b a l I d S t o r a g e F i n d ( n e w I D , t r u e , t r u e ) ;  
                                       i f   ( ( n e w I D ) & & ( ! t h i s . _ s A D n D ) )   t h i s . s e l e c t I t e m ( n e w I D , 0 , 1 ) ;  
                                 }  
  
                   }  
                 i f   ( z )   z . _ d r a g g e d = n e w   A r r a y ( ) ;  
  
  
 }  
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ d r a g I n = f u n c t i o n ( h t m l O b j e c t , s h t m l O b j e c t , x , y ) {  
  
                                         i f   ( ! t h i s . d A D T e m p O f f )   r e t u r n   0 ;  
                                         v a r   f o b j = s h t m l O b j e c t . p a r e n t O b j e c t ;  
                                         v a r   t o b j = h t m l O b j e c t . p a r e n t O b j e c t ;  
 	                                 i f   ( ( ! t o b j ) & & ( t h i s . _ d d r o n r ) )   r e t u r n ;  
                                         i f   ( ! t h i s . c a l l E v e n t ( " o n D r a g I n " , [ f o b j . i d , t o b j ? t o b j . i d : n u l l , f o b j . t r e e N o d , t h i s ] ) )  
 	 	 	 	 	 	 r e t u r n   0 ;  
  
 	 	 	 	 	 i f   ( ! t o b j )  
 	 	                               t h i s . a l l T r e e . c l a s s N a m e + = "   s e l e c t i o n B o x " ;  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 {  
 	                                         i f   ( f o b j . c h i l d N o d e s = = n u l l ) {  
 	 	                                 	 t h i s . _ s e t M o v e ( h t m l O b j e c t , x , y ) ;  
                 	                           	 r e t u r n   h t m l O b j e c t ;  
                                         	 }  
  
 	                                         v a r   s t r e e = f o b j . t r e e N o d ;  
         	                                 f o r   ( v a r   i = 0 ;   i < s t r e e . _ d r a g g e d . l e n g t h ;   i + + )  
                                                 	 i f   ( t h i s . _ c h e c k P N o d e s ( t o b j , s t r e e . _ d r a g g e d [ i ] ) ) {  
 	 	 	 	 	 	       	 	 t h i s . _ a u t o S c r o l l ( h t m l O b j e c t ) ;  
                                                       	 	 r e t u r n   0 ;  
 	 	 	 	 	 	 	 }  
 
                                               t h i s . _ s e t M o v e ( h t m l O b j e c t , x , y ) ;  
                                               i f   ( t h i s . _ g e t O p e n S t a t e ( t o b j ) < = 0 ) {  
                                                       t h i s . _ a u t o O p e n I d = t o b j . i d ;  
                                                           t h i s . _ a u t o O p e n T i m e r = w i n d o w . s e t T i m e o u t ( n e w   c a l l e r F u n c t i o n ( t h i s . _ a u t o O p e n I t e m , t h i s ) , 1 0 0 0 ) ;  
                                                                         }  
 	 	 	 	 	 }  
  
 	 	 	 	 r e t u r n   h t m l O b j e c t ;  
  
 }  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ a u t o O p e n I t e m = f u n c t i o n ( e , t r e e O b j e c t ) {  
       t r e e O b j e c t . o p e n I t e m ( t r e e O b j e c t . _ a u t o O p e n I d ) ;  
 } ;  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . _ d r a g O u t = f u n c t i o n ( h t m l O b j e c t ) {  
 t h i s . _ c l e a r M o v e ( ) ;  
 i f   ( t h i s . _ a u t o O p e n T i m e r )   c l e a r T i m e o u t ( t h i s . _ a u t o O p e n T i m e r ) ;  
   }  
  
  
 
  
  
 / / # c o m p l e x _ m o v e : 0 1 1 1 2 0 0 6 {  
  
 / * *  
 *           @ d e s c :   m o v e   i t e m   ( i n s i d e   o f   t r e e )  
 *           @ t y p e :     p u b l i c  
 *           @ p a r a m :   i t e m I d   -   i t e m   I d  
 *           @ p a r a m :   m o d e   -   m o v i n g   m o d e   ( l e f t , u p , d o w n , i t e m _ c h i l d , i t e m _ s i b l i n g , i t e m _ s i b l i n g _ n e x t , u p _ s t r i c t , d o w n _ s t r i c t )  
 *           @ p a r a m :   t a r g e t I d   -   t a r g e t   N o d e   i n   i t e m _ c h i l d   a n d   i t e m _ s i b l i n g   m o d e  
 *           @ p a r a m :   t a r g e t T r e e   -   u s e d   f o r   m o v i n g   b e t w e e n   t r e e s   ( o p t i o n a l )  
 *           @ r e t u r n :   n o d e   i d  
 *           @ t o p i c :   2  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . m o v e I t e m = f u n c t i o n ( i t e m I d , m o d e , t a r g e t I d , t a r g e t T r e e )  
 {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! s N o d e )   r e t u r n   ( 0 ) ;  
  
             s w i t c h ( m o d e ) {  
             c a s e   " r i g h t " :   a l e r t ( ' N o t   s u p p o r t e d   y e t ' ) ;  
                   b r e a k ;  
             c a s e   " i t e m _ c h i l d " :  
                             v a r   t N o d e = ( t a r g e t T r e e | | t h i s ) . _ g l o b a l I d S t o r a g e F i n d ( t a r g e t I d ) ;  
                             i f   ( ! t N o d e )   r e t u r n   ( 0 ) ;  
                         ( t a r g e t T r e e | | t h i s ) . _ m o v e N o d e T o ( s N o d e , t N o d e , 0 ) ;  
                   b r e a k ;  
             c a s e   " i t e m _ s i b l i n g " :  
                             v a r   t N o d e = ( t a r g e t T r e e | | t h i s ) . _ g l o b a l I d S t o r a g e F i n d ( t a r g e t I d ) ;  
                             i f   ( ! t N o d e )   r e t u r n   ( 0 ) ;  
                         ( t a r g e t T r e e | | t h i s ) . _ m o v e N o d e T o ( s N o d e , t N o d e . p a r e n t O b j e c t , t N o d e ) ;  
                   b r e a k ;  
             c a s e   " i t e m _ s i b l i n g _ n e x t " :  
                             v a r   t N o d e = ( t a r g e t T r e e | | t h i s ) . _ g l o b a l I d S t o r a g e F i n d ( t a r g e t I d ) ;  
                             i f   ( ! t N o d e )   r e t u r n   ( 0 ) ;  
                                     i f   ( ( t N o d e . t r ) & & ( t N o d e . t r . n e x t S i b l i n g ) & & ( t N o d e . t r . n e x t S i b l i n g . n o d e m ) )  
                                 ( t a r g e t T r e e | | t h i s ) . _ m o v e N o d e T o ( s N o d e , t N o d e . p a r e n t O b j e c t , t N o d e . t r . n e x t S i b l i n g . n o d e m ) ;  
                                 e l s e  
                                         ( t a r g e t T r e e | | t h i s ) . _ m o v e N o d e T o ( s N o d e , t N o d e . p a r e n t O b j e c t ) ;  
                   b r e a k ;  
             c a s e   " l e f t " :   i f   ( s N o d e . p a r e n t O b j e c t . p a r e n t O b j e c t )  
                         t h i s . _ m o v e N o d e T o ( s N o d e , s N o d e . p a r e n t O b j e c t . p a r e n t O b j e c t , s N o d e . p a r e n t O b j e c t ) ;  
                   b r e a k ;  
             c a s e   " u p " :   v a r   z = t h i s . _ g e t P r e v N o d e ( s N o d e ) ;  
                               i f   ( ( z = = - 1 ) | | ( ! z . p a r e n t O b j e c t ) )   r e t u r n ;  
                               t h i s . _ m o v e N o d e T o ( s N o d e , z . p a r e n t O b j e c t , z ) ;  
                   b r e a k ;  
             c a s e   " u p _ s t r i c t " :   v a r   z = t h i s . _ g e t I n d e x ( s N o d e ) ;  
                                                     i f   ( z ! = 0 )  
                                                   t h i s . _ m o v e N o d e T o ( s N o d e , s N o d e . p a r e n t O b j e c t , s N o d e . p a r e n t O b j e c t . c h i l d N o d e s [ z - 1 ] ) ;  
                   b r e a k ;  
             c a s e   " d o w n _ s t r i c t " :   v a r   z = t h i s . _ g e t I n d e x ( s N o d e ) ;  
                                                         v a r   c o u n t = s N o d e . p a r e n t O b j e c t . c h i l d s C o u n t - 2 ;  
                                                         i f   ( z = = c o u n t )  
                                                           t h i s . _ m o v e N o d e T o ( s N o d e , s N o d e . p a r e n t O b j e c t ) ;  
                                                         e l s e   i f   ( z < c o u n t )  
                                                           t h i s . _ m o v e N o d e T o ( s N o d e , s N o d e . p a r e n t O b j e c t , s N o d e . p a r e n t O b j e c t . c h i l d N o d e s [ z + 2 ] ) ;  
                   b r e a k ;  
             c a s e   " d o w n " :   v a r   z = t h i s . _ g e t N e x t N o d e ( t h i s . _ l a s t C h i l d ( s N o d e ) ) ;  
                               i f   ( ( z = = - 1 ) | | ( ! z . p a r e n t O b j e c t ) )   r e t u r n ;  
                               i f   ( z . p a r e n t O b j e c t = = s N o d e . p a r e n t O b j e c t )  
                                     v a r   z = t h i s . _ g e t N e x t N o d e ( z ) ;  
                                                 i f   ( z = = - 1 ) {  
                                                 t h i s . _ m o v e N o d e T o ( s N o d e , s N o d e . p a r e n t O b j e c t ) ;  
                                                 }  
                                                 e l s e  
                                                 {  
                                               i f   ( ( z = = - 1 ) | | ( ! z . p a r e n t O b j e c t ) )   r e t u r n ;  
                                               t h i s . _ m o v e N o d e T o ( s N o d e , z . p a r e n t O b j e c t , z ) ;  
                                                 }  
                   b r e a k ;  
             }  
 }  
  
 
 / / # }  
  
  
  
  
  
  
  
 / * *  
 *           @ d e s c :   l o a d   x m l   f o r   t r e e   b r a n c h  
 *           @ p a r a m :   i d   -   i d   o f   p a r e n t   n o d e  
 *           @ p a r a m :   s r c   -   p a t h   t o   x m l ,   o p t i o n a l  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   1  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ l o a d D y n X M L = f u n c t i o n ( i d , s r c )   {  
       	 	 s r c = s r c | | t h i s . X M L s o u r c e ;  
                 v a r   s n = ( n e w   D a t e ( ) ) . v a l u e O f ( ) ;  
                 t h i s . _ l d _ i d = i d ;  
 
                         t h i s . l o a d X M L ( s r c + g e t U r l S y m b o l ( s r c ) + " u i d = " + s n + " & i d = " + t h i s . _ e s c a p e ( i d ) ) ;  
                 } ;  
  
  
 
  
  
  
  
 / * *  
 *           @ d e s c :   c h e c k   p o s s i b i l i t y   o f   d r a g - a n d - d r o p  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   i t e m I d   -   d r a g e d   n o d e   i d  
 *           @ p a r a m :   h t m l O b j e c t   -   d r o p e d   n o d e   o b j e c t  
 *           @ p a r a m :   s h t m l O b j e c t   -   s o u r s e   n o d e   o b j e c t  
 *           @ t o p i c :   6  
 * /  
         d h t m l X T r e e O b j e c t . p r o t o t y p e . _ c h e c k P N o d e s = f u n c t i o n ( i t e m 1 , i t e m 2 ) {  
             i f   ( i t e m 2 = = i t e m 1 )   r e t u r n   1  
             i f   ( i t e m 1 . p a r e n t O b j e c t )   r e t u r n   t h i s . _ c h e c k P N o d e s ( i t e m 1 . p a r e n t O b j e c t , i t e m 2 ) ;   e l s e   r e t u r n   0 ;  
       } ;  
  
  
  
 
  
  
  
  
 
  
 / * *  
 *       @ d e s c :     p r e v e n t   c a c h i n g   i n   I E     b y   a d d i n g   r a n d o m   s e e d   t o   U R L   s t r i n g  
 *       @ p a r a m :   m o d e   -   e n a b l e / d i s a b l e   r a n d o m   s e e d   (   d i s a b l e d   b y   d e f a u l t   )  
 *       @ t y p e :   p u b l i c  
 *       @ t o p i c :   0  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . p r e v e n t I E C a c h i n g = f u n c t i o n ( m o d e ) {  
             t h i s . n o _ c a s h e   =   c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;  
             t h i s . X M L L o a d e r . r S e e d = t h i s . n o _ c a s h e ;  
 }  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . p r e v e n t I E C a s h i n g = d h t m l X T r e e O b j e c t . p r o t o t y p e . p r e v e n t I E C a c h i n g ;  
  
  
  
  
 / / # t r e e _ e x t r a : 0 1 1 1 2 0 0 6 {  
  
 / * *  
 *           @ d e s c :   d i s a b l e   c h e c k b o x  
 *           @ p a r a m :   i t e m I d   -   I d   o f   t r e e   i t e m  
 *           @ p a r a m :   m o d e   -   1   -   o n ,   0   -   o f f ;  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . d i s a b l e C h e c k b o x = f u n c t i o n ( i t e m I d , m o d e )   {  
                         i f   ( t y p e o f ( i t e m I d ) ! = " o b j e c t " )  
                           v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d , 0 , 1 ) ;  
                         e l s e  
                                 v a r   s N o d e = i t e m I d ;  
                   i f   ( ! s N o d e )   r e t u r n ;  
                         s N o d e . d s c h e c k = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ? ( ( ( s N o d e . c h e c k s t a t e | | 0 ) % 3 ) + 3 ) : ( ( s N o d e . c h e c k s t a t e > 2 ) ? ( s N o d e . c h e c k s t a t e - 3 ) : s N o d e . c h e c k s t a t e ) ;  
                         t h i s . _ s e t C h e c k ( s N o d e ) ;  
                                 i f   ( s N o d e . d s c h e c k < 3 )   s N o d e . d s c h e c k = f a l s e ;  
                   } ;  
  
 
  
  
 / * *  
 *           @ d e s c :   s e t   e s c a p i n g   m o d e   ( u s e d   f o r   e s c a p i n g   I D   i n   s e r v e r   r e q u e s t s )  
 *           @ p a r a m :   m o d e   -   e s c a p i n g   m o d e   ( " u t f 8 "   f o r   U T F   e s c a p i n g )  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t E s c a p i n g M o d e = f u n c t i o n ( m o d e ) {  
                 t h i s . u t f e s c = m o d e ;  
                 }  
  
  
 / * *  
 *           @ d e s c :   e n a b l e   i t e m   h i g h l i g h t i n g   ( i t e m   t e x t   h i g h l i t e d   o n   m o u s e o v e r )  
 *           @ b e f o r e I n i t :   1  
 *           @ p a r a m :   m o d e   -   1   -   o n ,   0   -   o f f ;  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e H i g h l i g h t i n g = f u n c t i o n ( m o d e )   {   t h i s . e h l t = t r u e ;   t h i s . e h l t a = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;   } ;  
  
 / * *  
 *           @ d e s c :   c a l l e d   o n   m o u s e   o u t  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ i t e m M o u s e O u t = f u n c t i o n ( ) {  
       	 	 v a r   t h a t = t h i s . c h i l d N o d e s [ 3 ] . p a r e n t O b j e c t ;  
 	 	 v a r   t r e e = t h a t . t r e e N o d ;  
   	 	 t r e e . c a l l E v e n t ( " o n M o u s e O u t " , [ t h a t . i d ] ) ;  
 	 	 i f   ( t h a t . i d = = t r e e . _ l _ o n M S I )   t r e e . _ l _ o n M S I = n u l l ;  
                 i f   ( ! t r e e . e h l t a )   r e t u r n ;  
   	         t h a t . s p a n . c l a s s N a m e = t h a t . s p a n . c l a s s N a m e . r e p l a c e ( " _ l o r " , " " ) ;  
       }  
 / * *  
 *           @ d e s c :   c a l l e d   o n   m o u s e   i n  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ i t e m M o u s e I n = f u n c t i o n ( ) {  
       	 	 v a r   t h a t = t h i s . c h i l d N o d e s [ 3 ] . p a r e n t O b j e c t ;  
 	 	 v a r   t r e e = t h a t . t r e e N o d ;  
  
 	 	 i f   ( t r e e . _ l _ o n M S I ! = t h a t . i d )   t r e e . c a l l E v e n t ( " o n M o u s e I n " , [ t h a t . i d ] ) ;  
 	 	 t r e e . _ l _ o n M S I = t h a t . i d ;  
                 i f   ( ! t r e e . e h l t a )   r e t u r n ;  
   	         t h a t . s p a n . c l a s s N a m e = t h a t . s p a n . c l a s s N a m e . r e p l a c e ( " _ l o r " , " " ) ;  
   	         t h a t . s p a n . c l a s s N a m e = t h a t . s p a n . c l a s s N a m e . r e p l a c e ( / ( ( s t a n d a r t | s e l e c t e d ) T r e e R o w ) / , " $ 1 _ l o r " ) ;  
       }  
  
 / * *  
 *           @ d e s c :   e n a b l e   a c t i v e   i m a g e s   ( c l i c k a b l e   a n d   d r a g a b l e )  
 *           @ b e f o r e I n i t :   1  
 *           @ p a r a m :   m o d e   -   1   -   o n ,   0   -   o f f ;  
 *           @ t y p e :   p u b l i c  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e A c t i v e I m a g e s = f u n c t i o n ( m o d e ) { t h i s . _ a i m g s = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;   } ;  
  
 / * *  
 *           @ d e s c :   f o c u s   i t e m   i n   t r e e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   i t e m   I d  
 *           @ t o p i c :   0  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . f o c u s I t e m = f u n c t i o n ( i t e m I d ) {  
             v a r   s N o d e = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! s N o d e )   r e t u r n   ( 0 ) ;  
             t h i s . _ f o c u s N o d e ( s N o d e ) ;  
       } ;  
  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   a l l   n e x t   l e v e l s   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   a l l   n e x t   l e v e l s   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l S u b I t e m s   = f u n c t i o n ( i t e m I d ) {  
             r e t u r n   t h i s . _ g e t A l l S u b I t e m s ( i t e m I d ) ;  
       }  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   i t e m s   w h i c h   d o e s n ' t   h a v e   c h i l d   n o d e s .  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   a l l   i t e m s   w h i c h   d o e s n ' t   h a v e   c h i l d   n o d e s .  
 *           @ t o p i c :   6  
 * /  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l C h i l d l e s s   = f u n c t i o n ( ) {  
 	 	 r e t u r n   t h i s . _ g e t A l l S c r a g g y I t e m s ( t h i s . h t m l N o d e ) ;  
 	 }  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l L e a f s = d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l C h i l d l e s s ;  
  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   a l l   n e x t   l e v e l s   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t y p e :   p r i v a t e  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t A l l S c r a g g y I t e m s   = f u n c t i o n ( n o d e )  
       {  
             v a r   z = " " ;  
             f o r   ( v a r   i = 0 ;   i < n o d e . c h i l d s C o u n t ;   i + + )  
                 {  
                         i f   ( ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d ) | | ( n o d e . c h i l d N o d e s [ i ] . c h i l d s C o u n t > 0 ) )  
                         {  
                                         i f   ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d )  
                                                 v a r   z b = t h i s . _ g e t A l l S c r a g g y I t e m s X M L ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d , 1 ) ;  
                                         e l s e  
                                               v a r   z b = t h i s . _ g e t A l l S c r a g g y I t e m s ( n o d e . c h i l d N o d e s [ i ] )  
  
                                   i f   ( z b )  
                                                 i f   ( z )   z + = t h i s . d l m t r + z b ;  
                                                 e l s e   z = z b ;  
                   }  
                         e l s e  
                               i f   ( ! z )   z = n o d e . c h i l d N o d e s [ i ] . i d ;  
                           e l s e   z + = t h i s . d l m t r + n o d e . c h i l d N o d e s [ i ] . i d ;  
                   }  
                     r e t u r n   z ;  
       } ;  
  
  
  
  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   c h i l d r e n   i t e m s   f r o m   a l l   n e x t   l e v e l s   o f   t r e e ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ p a r a m :   i t e m I d   -   i d   o f   n o d e  
 *           @ t y p e :   p r i v a t e  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   6  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t A l l F a t I t e m s   = f u n c t i o n ( n o d e )  
       {  
             v a r   z = " " ;  
             f o r   ( v a r   i = 0 ;   i < n o d e . c h i l d s C o u n t ;   i + + )  
                 {  
                         i f   ( ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d ) | | ( n o d e . c h i l d N o d e s [ i ] . c h i l d s C o u n t > 0 ) )  
                         {  
                           i f   ( ! z )   z = n o d e . c h i l d N o d e s [ i ] . i d ;  
                                 e l s e   z + = t h i s . d l m t r + n o d e . c h i l d N o d e s [ i ] . i d ;  
  
                                         i f   ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d )  
                                                 v a r   z b = t h i s . _ g e t A l l F a t I t e m s X M L ( n o d e . c h i l d N o d e s [ i ] . u n P a r s e d , 1 ) ;  
                                         e l s e  
                                               v a r   z b = t h i s . _ g e t A l l F a t I t e m s ( n o d e . c h i l d N o d e s [ i ] )  
  
                                   i f   ( z b )   z + = t h i s . d l m t r + z b ;  
                   }  
                   }  
                     r e t u r n   z ;  
       } ;  
  
 / * *  
 *           @ d e s c :   R e t u r n s   t h e   l i s t   o f   a l l   i t e m s   w h i c h   h a s   c h i l d   n o d e s ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   a l l   i t e m s   w h i c h   h a s   c h i l d   n o d e s ,   s e p a r a t e d   b y   c o m m a s .  
 *           @ t o p i c :   6  
 * /  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l I t e m s W i t h K i d s   = f u n c t i o n ( ) {  
 	 	 r e t u r n   t h i s . _ g e t A l l F a t I t e m s ( t h i s . h t m l N o d e ) ;  
 	 }  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l F a t I t e m s = d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l I t e m s W i t h K i d s ;  
  
  
  
 / * *  
 *           @ d e s c :   r e t u r n   l i s t   o f   i d e n t i f i c a t o r s   o f   n o d e s   w i t h   c h e c k e d   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   I D   o f   i t e m s   w i t h   c h e c k e d   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l C h e c k e d = f u n c t i o n ( ) {  
             r e t u r n   t h i s . _ g e t A l l C h e c k e d ( " " , " " , 1 ) ;  
       }  
 / * *  
 *           @ d e s c :   r e t u r n   l i s t   o f   i d e n t i f i c a t o r s   o f   n o d e s   w i t h   u n c h e c k e d   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   I D   o f   i t e m s   w i t h   u n c h e c k e d   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l U n c h e c k e d = f u n c t i o n ( i t e m I d ) {  
                 i f   ( i t e m I d )  
                         i t e m I d = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             r e t u r n   t h i s . _ g e t A l l C h e c k e d ( i t e m I d , " " , 0 ) ;  
         }  
  
  
 / * *  
 *           @ d e s c :   r e t u r n   l i s t   o f   i d e n t i f i c a t o r s   o f   n o d e s   w i t h   t h i r d   s t a t e   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   I D   o f   i t e m s   w i t h   t h i r d   s t a t e   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l P a r t i a l l y C h e c k e d = f u n c t i o n ( ) {  
             r e t u r n   t h i s . _ g e t A l l C h e c k e d ( " " , " " , 2 ) ;  
       }  
  
  
 / * *  
 *           @ d e s c :   r e t u r n   l i s t   o f   i d e n t i f i c a t o r s   o f   n o d e s   w i t h   c h e c k e d   a n d   t h i r d   s t a t e   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t y p e :   p u b l i c  
 *           @ r e t u r n :   l i s t   o f   I D   o f   i t e m s   w i t h   c h e c k e d   a n d   t h i r d   s t a t e   c h e c k b o x e s ,   s e p a r a t e d   b y   c o m m a  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . g e t A l l C h e c k e d B r a n c h e s = f u n c t i o n ( ) {  
                 v a r   t e m p =   t h i s . _ g e t A l l C h e c k e d ( " " , " " , 1 ) ;  
                 i f   ( t e m p ! = " " )   t e m p + = t h i s . d l m t r ;  
                   r e t u r n   t e m p + t h i s . _ g e t A l l C h e c k e d ( " " , " " , 2 ) ;  
       }  
  
 / * *  
 *           @ d e s c :   r e t u r n   l i s t   o f   i d e n t i f i c a t o r s   o f   n o d e s   w i t h   c h e c k e d   c h e c k b o x e s  
 *           @ t y p e :   p r i v a t e  
 *           @ p a r a m :   n o d e   -   n o d e   o b j e c t   ( o p t i o n a l ,   u s e d   b y   p r i v a t e   m e t h o d s )  
 *           @ p a r a m :   l i s t   -   i n i t i a l   i d e n t i f i c a t o r s   l i s t   ( o p t i o n a l ,   u s e d   b y   p r i v a t e   m e t h o d s )  
 *           @ t o p i c :   5  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . _ g e t A l l C h e c k e d = f u n c t i o n ( h t m l N o d e , l i s t , m o d e ) {  
             i f   ( ! h t m l N o d e )   h t m l N o d e = t h i s . h t m l N o d e ;  
  
             i f   ( h t m l N o d e . c h e c k s t a t e = = m o d e )  
                   i f   ( ! h t m l N o d e . n o c h e c k b o x )     {   i f   ( l i s t )   l i s t + = t h i s . d l m t r + h t m l N o d e . i d ;   e l s e   l i s t = h t m l N o d e . i d ;     }  
             v a r   j = h t m l N o d e . c h i l d s C o u n t ;  
             f o r   ( v a r   i = 0 ;   i < j ;   i + + )  
             {  
                   l i s t = t h i s . _ g e t A l l C h e c k e d ( h t m l N o d e . c h i l d N o d e s [ i ] , l i s t , m o d e ) ;  
             } ;  
 
  
             i f   ( l i s t )   r e t u r n   l i s t ;   e l s e   r e t u r n   " " ;  
       } ;  
  
 / * *  
 *           @ d e s c :   s e t   i n d i v i d u a l   i t e m   s t y l e  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   i t e m I d   -   n o d e   i d  
 *           @ p a r a m :   s t y l e _ s t r i n g   -   v a l i d   C S S   s t r i n g  
 *           @ t o p i c :   2  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t I t e m S t y l e = f u n c t i o n ( i t e m I d , s t y l e _ s t r i n g ) {  
             v a r   t e m p = t h i s . _ g l o b a l I d S t o r a g e F i n d ( i t e m I d ) ;  
             i f   ( ! t e m p )   r e t u r n   0 ;  
             i f   ( ! t e m p . s p a n . s t y l e . c s s T e x t )  
                         t e m p . s p a n . s e t A t t r i b u t e ( " s t y l e " , t e m p . s p a n . g e t A t t r i b u t e ( " s t y l e " ) + " ;   " + s t y l e _ s t r i n g ) ;  
                 e l s e  
                     t e m p . s p a n . s t y l e . c s s T e x t + = ( " ; " + s t y l e _ s t r i n g ) ;  
 }  
  
 / * *  
 *           @ d e s c :   c r e a t e   e n a b l e   d r a g i n g   o f   i t e m   i m a g e   w i t h   i t e m   t e x t  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   m o d e   -   t r u e / f a l s e  
 *           @ t o p i c :   1  
 * /  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e I m a g e D r a g = f u n c t i o n ( m o d e ) {  
         t h i s . _ i t i m _ d g = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;  
 }  
  
 / * *  
 *           @ d e s c :   s e t   f u n c t i o n   c a l l e d   w h e n   t r e e   i t e m   d r a g e d   o v e r   a n o t h e r   i t e m  
 *           @ p a r a m :   f u n c   -   e v e n t   h a n d l i n g   f u n c t i o n  
 *           @ t y p e :   p u b l i c  
 *           @ e d i t i o n :   P r o f e s s i o n a l  
 *           @ t o p i c :   4  
 *           @ e v e n t :   o n D r a g I n  
 *           @ d e p r i c a t e d :   u s e   g r i d . a t t a c h E v e n t ( " o n D r a g I n " , f u n c ) ;   i n s t e a d  
 *           @ e v e n t d e s c :   E v e n t   r a i s e d   w h e n   i t e m   d r a g e d   o t h e r   o t h e r   d r o p a b l e   t a r g e t  
 *           @ e v e n t p a r a m :     I D   d r a g e d   i t e m  
 *           @ e v e n t p a r a m :     I D   p o t e n c i a l   d r o p   l a n d i n g  
 *           @ e v e n t p a r a m :     s o u r c e   o b j e c t  
 *           @ e v e n t p a r a m :     t a r g e t   o b j e c t  
 *           @ e v e n t r e t u r n :   t r u e   -   a l l o w   d r o p ;   f a l s e   -   d e n y   d r o p ;  
 * /  
 	 d h t m l X T r e e O b j e c t . p r o t o t y p e . s e t O n D r a g I n = f u n c t i o n ( f u n c ) {  
 	 	 t h i s . a t t a c h E v e n t ( " o n D r a g I n " , f u n c ) ;  
                 } ;  
  
 / * *  
 *           @ d e s c :   e n a b l e / d i s a b l e   a u t o   s c r o l l i n g   w h i l e   d r a g - a n d - d r o p  
 *           @ t y p e :   p u b l i c  
 *           @ p a r a m :   m o d e   -   e n a b l e d / d i s a b l e d  
 *           @ t o p i c :   0  
 * /  
       d h t m l X T r e e O b j e c t . p r o t o t y p e . e n a b l e D r a g A n d D r o p S c r o l l i n g = f u n c t i o n ( m o d e ) {   t h i s . a u t o S c r o l l = c o n v e r t S t r i n g T o B o o l e a n ( m o d e ) ;   } ;  
 / / # }  
  
  
 d h t m l X T r e e O b j e c t . p r o t o t y p e . d h x _ E v e n t = f u n c t i o n ( )  
 {  
       t h i s . d h x _ S e v e r C a t c h e r P a t h = " " ;  
  
       t h i s . a t t a c h E v e n t   =   f u n c t i o n ( o r i g i n a l ,   c a t c h e r ,   C a l l O b j )  
       {  
             i f   ( t h i s . _ o n E v e n t S e t   & &   t h i s . _ o n E v e n t S e t [ o r i g i n a l ] )  
 	     	 t h i s . _ o n E v e n t S e t [ o r i g i n a l ] . a p p l y ( t h i s , [ ] ) ;  
  
             C a l l O b j   =   C a l l O b j | | t h i s ;  
             o r i g i n a l   =   ' e v _ ' + o r i g i n a l ;  
               i f   (   (   ! t h i s [ o r i g i n a l ]   )   | |   (   ! t h i s [ o r i g i n a l ] . a d d E v e n t   )   )   {  
                       v a r   z   =   n e w   t h i s . e v e n t C a t c h e r ( C a l l O b j ) ;  
                       z . a d d E v e n t (   t h i s [ o r i g i n a l ]   ) ;  
                       t h i s [ o r i g i n a l ]   =   z ;  
               }  
               r e t u r n   (   o r i g i n a l   +   ' : '   +   t h i s [ o r i g i n a l ] . a d d E v e n t ( c a t c h e r )   ) ;       / / r e t u r n   I D   ( e v e n t   n a m e   &   e v e n t   I D )  
       }  
       t h i s . c a l l E v e n t = f u n c t i o n ( n a m e , a ) {  
                   i f   ( t h i s [ " e v _ " + n a m e ] )   r e t u r n   t h i s [ " e v _ " + n a m e ] . a p p l y ( t h i s , a ) ;  
 	 	   r e t u r n   t r u e ;  
       }  
       t h i s . c h e c k E v e n t = f u n c t i o n ( n a m e ) {  
                   i f   ( t h i s [ " e v _ " + n a m e ] )   r e t u r n   t r u e ;  
 	 	   r e t u r n   f a l s e ;  
       }  
  
       t h i s . e v e n t C a t c h e r   =   f u n c t i o n ( o b j )  
       {  
               v a r   d h x _ c a t c h   =   n e w   A r r a y ( ) ;  
               v a r   m _ o b j   =   o b j ;  
               v a r   f u n c _ s e r v e r   =   f u n c t i o n ( c a t c h e r , r p c )  
                                                   {  
                                                       c a t c h e r   =   c a t c h e r . s p l i t ( " : " ) ;  
 	 	 	 	 	 	       v a r   p o s t V a r = " " ;  
 	 	 	 	 	 	       v a r   p o s t V a r 2 = " " ;  
                                                       v a r   t a r g e t = c a t c h e r [ 1 ] ;  
 	 	 	 	 	 	       i f   ( c a t c h e r [ 1 ] = = " r p c " ) {  
 	 	 	 	 	 	       	 	 p o s t V a r = ' < ? x m l   v e r s i o n = " 1 . 0 " ? > < m e t h o d C a l l > < m e t h o d N a m e > ' + c a t c h e r [ 2 ] + ' < / m e t h o d N a m e > < p a r a m s > ' ;  
 	 	 	 	 	 	 	 	 p o s t V a r 2 = " < / p a r a m s > < / m e t h o d C a l l > " ;  
 	 	 	 	 	 	 	 	 t a r g e t = r p c ;  
 	 	 	 	 	 	       }  
                                                       v a r   z   =   f u n c t i o n ( )   {  
                                                                               v a r   l o a d e r   =   n e w   d t m l X M L L o a d e r O b j e c t (   n u l l ,   w i n d o w ,   f a l s e   ) ;  
 	 	 	 	 	 	 	 	 	       v a r   r e q u e s t = p o s t V a r ;  
 	 	 	 	 	 	 	 	 	       i f   ( p o s t V a r 2 ) {  
 	                                                                               f o r   ( v a r   i = 0 ;   i < a r g u m e n t s . l e n g t h ;   i + + )  
         	                                                                               r e q u e s t   + =   " < p a r a m > < v a l u e > < s t r i n g > " + ( a r g u m e n t s [ i ] ? a r g u m e n t s [ i ] . t o S t r i n g ( ) : " " ) + " < / s t r i n g > < / v a l u e > < / p a r a m > " ;  
 	 	 	 	 	 	 	 	 	 	       r e q u e s t + = p o s t V a r 2 ;  
 	 	 	 	 	 	 	 	 	       }  
 	 	 	 	 	 	 	 	 	       e l s e  
                                                                               f o r   ( v a r   i = 0 ;   i < a r g u m e n t s . l e n g t h ;   i + + )  
                                                                                       r e q u e s t   + =   (   ' & a r g ' + i + ' = ' + e s c a p e ( a r g u m e n t s [ i ] ) ) ;  
  
                                                                               l o a d e r . l o a d X M L (   t a r g e t ,   t r u e ,   r e q u e s t , p o s t V a r 2 ? t r u e : f a l s e ) ;  
  
                                                                               t r y {  
 	 	 	 	 	 	 	 	 	 	 i f   ( p o s t V a r 2 ) {  
 	 	 	 	 	 	 	 	 	       	 	 v a r   d t = l o a d e r . d o X P a t h ( " / / m e t h o d R e s p o n s e / p a r a m s / p a r a m / v a l u e / s t r i n g " ) ;  
 	 	 	 	 	 	 	 	 	 	 	 r e t u r n   c o n v e r t S t r i n g T o B o o l e a n ( d t [ 0 ] . f i r s t C h i l d . d a t a ) ;  
 	 	 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 	 	 e l s e   r e t u r n   c o n v e r t S t r i n g T o B o o l e a n ( l o a d e r . x m l D o c . r e s p o n s e T e x t ) ;  
 	 	 	 	 	 	 	 	 	       }  
 	 	 	 	 	 	 	 	 	       c a t c h ( e ) {  
  
 	 	 	 	 	 	 	 	 	       	 d h t m l x E r r o r . t h r o w E r r o r ( " r p c E r r o r " , l o a d e r . x m l D o c . r e s p o n s e T e x t ) ;  
 	 	 	 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 	 	 	       }  
                                                                       }  
                                                       r e t u r n   z ;  
                                                   }  
               v a r   z   =   f u n c t i o n ( )  
                           {  
                                       i f   ( d h x _ c a t c h )  
                                             v a r   r e s = t r u e ;  
                                       f o r   ( v a r   i = 0 ;   i < d h x _ c a t c h . l e n g t h ;   i + + )   {  
                                             i f   ( d h x _ c a t c h [ i ]   ! =   n u l l )   {  
                                                       v a r   z r   =   d h x _ c a t c h [ i ] . a p p l y (   m _ o b j ,   a r g u m e n t s   ) ;  
                                                       r e s   =   r e s   & &   z r ;  
                                             }  
                                       }  
                                       r e t u r n   r e s ;  
                                 }  
               z . a d d E v e n t   =   f u n c t i o n ( e v )  
                                 {  
                                               i f   (   t y p e o f ( e v )   ! =   " f u n c t i o n "   )  
                                                       i f   ( e v   & &   e v . i n d e x O f   & &   e v . i n d e x O f ( " s e r v e r : " )   = = =   0 )  
                                                               e v   =   n e w   f u n c _ s e r v e r ( e v , m _ o b j . r p c S e r v e r ) ;  
                                                       e l s e  
                                                               e v   =   e v a l ( e v ) ;  
                                               i f   ( e v )  
                                                       r e t u r n   d h x _ c a t c h . p u s h (   e v   )   -   1 ;  
                                               r e t u r n   f a l s e ;  
                                 }  
               z . r e m o v e E v e n t   =   f u n c t i o n ( i d )  
                                       {  
                                           d h x _ c a t c h [ i d ]   =   n u l l ;  
                                       }  
               r e t u r n   z ;  
       }  
  
       t h i s . d e t a c h E v e n t   =   f u n c t i o n ( i d )  
       {  
             i f   ( i d   ! =   f a l s e )   {  
                   v a r   l i s t   =   i d . s p l i t ( ' : ' ) ;                         / / g e t   E v e n t N a m e   a n d   I D  
                   t h i s [   l i s t [ 0 ]   ] . r e m o v e E v e n t (   l i s t [ 1 ]   ) ;       / / r e m o v e   e v e n t  
             }  
       }  
 }  
 
