ÿþ 
 / / G e n e r a l   c o n f i g u r a t i o n  
  
 v a r   s I m a g e N o n e   =   s I m a g e s P a t h   +   " n o n e . g i f " ;  
 v a r   s I m a g e P l u s   =   s I m a g e s P a t h   +   " p l u s . g i f " ;  
 v a r   s I m a g e M i n u s   =   s I m a g e s P a t h   +   " m i n u s . g i f " ;  
  
 / / S t y l e s  
 v a r   s N o d e L o a d i n g C l a s s   =   " B e i n g L o a d e d N o d e " ;  
 v a r   s N o d e C l a s s   =   " T r e e N o d e " ;  
  
 / / T e x t  
 v a r   s C a n c e l L o a d i n g   =   " J©  D-8G  D7A'  . . . " ;  
  
 / / T i m e o u t   d u r i n g   w h i c h   n o d e   w i l l   b e   l o a d e d  
 v a r   t i m e O u t   =   6 0 0 0 0 ;  
  
 / / S e l e c t e d   n o d e  
 v a r   o S e l N o d e ;  
  
 / / C u r e n t   l o a d i n g   n o d e .   O n l y   o n e   n o d e   c a n   b e   b e i n g   l o a d i n g   a t   o n e   m o m e n t ! * /  
 v a r   b e i n g L o a d e d N o d e ;  
  
 / / C u r r e n t   n o d e   c o u n t e r .   W e   u s e   i t   f o r   g e n e r a t i o n   u n i q u e   I D  
 v a r   n o d e I d   =   0 ;  
  
 / / I n i t   d a t a   a n d   s t a r t   l o a d i n g   r o o t   t r e e  
 f u n c t i o n   i n i t P a g e ( ) {  
 	 o S e l N o d e   =   n u l l ;  
 	 / / s e t   b e i n g L o a d e d N o d e   t o   t h e   t r e e   c o n t a i n e r  
 	 b e i n g L o a d e d N o d e   =   d o c u m e n t . g e t E l e m e n t B y I d ( " T r e e " ) ;  
 	 p r o c e s s L o a d i n g ( s R o o t T r e e ) ; 	  
 }  
  
 / / L o a d   s u b t r e e   i n t o   h i d d e n   f r a m e  
 f u n c t i o n   p r o c e s s L o a d i n g ( s T r e e U R L ) { 	  
 	 w i n d o w . t o c L o a d e r . l o c a t i o n   =   s T r e e U R L ;  
 	 / / W e   w i l l   c a n c e l   l o a d i n g   o f   t r e e   i f   i t   w i l l n ' t   h a v e   s u c c e s s   d u r i n g   t i m e o u t  
 	 / / w i n d o w . s e t T i m e o u t ( " c a n c e l L o a d B y T i m e o u t ( ' "   +   b e i n g L o a d e d N o d e . i d   +   " ' ) ; " ,   t i m e O u t ) ;  
 	  
 }  
  
 / / S h o w   h i n t   [ L o a d i n g . . . ]  
 f u n c t i o n   s h o w B e i n g L o a d e d N o d e ( ) {  
 	 v a r   o D I V   =   b e i n g L o a d e d N o d e . 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 E l e m e n t ( " d i v " ) ) ;  
 	 o D I V . c l a s s N a m e   =   s N o d e L o a d i n g C l a s s ;  
 	 v a r   o A   =   o D I V . 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 E l e m e n t ( " a " ) ) ;  
 	 o A . h r e f   =   " # " ;  
 	 o A . t i t l e   =   " 'F51'A  . . . "  
 	 o A . o n c l i c k   =   c a n c e l L o a d ; 	  
 	 v a r 	 o T e x t   =   o A . 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 ( s C a n c e l L o a d i n g ) ) ;  
 }  
  
 / / H i d e   h i n t   [ L o a d i n g . . . ]  
 f u n c t i o n   h i d e B e i n g L o a d e d N o d e ( ) { 	  
 	 i f   ( b e i n g L o a d e d N o d e . c h i l d N o d e s . l e n g t h > 1 ) {  
 	 	 v a r   o D I V   =   b e i n g L o a d e d N o d e . c h i l d N o d e s [ 1 ] ; 	 	 	  
 	 	 b e i n g L o a d e d N o d e . r e m o v e C h i l d ( o D I V ) ;    
 	 }  
 }  
  
 / / C a n c e l   l o a d i n g   o f   n o d e  
 f u n c t i o n   c a n c e l L o a d B y T i m e o u t ( i d ) {  
 	 / / C h e c k   i f   n o d e   i s   s t i l l     l o a d e d  
 	 i f   ( b e i n g L o a d e d N o d e ! = n u l l   & &   b e i n g L o a d e d N o d e . i d = = i d ) {  
 	 	 h i d e B e i n g L o a d e d N o d e ( ) ;  
 	 	 / / C h e c k   w h e t h e r   i t s   t o p   c o n t a i n e r   n o d e  
 	 	 i f   ( b e i n g L o a d e d N o d e . c h i l d N o d e s . l e n g t h > 0 ) {  
 	 	 	 b e i n g L o a d e d 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 r c   =   s I m a g e N o n e ;  
 	 	 	 b e i n g L o a d e d 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 ] . o n c l i c k   =   n u l l ;  
 	 	 }  
 	 	 b e i n g L o a d e d N o d e   =   n u l l ; 	  
 	 	 a l e r t ( " 9/E  EHABJ*  /1  ('1¯0'1PÌ  3'.*'1  /1.*J" ) ; 	 	 	  
 	 }  
 }  
  
 / / T h i s   f u n c t i o n   h a n d l e s   O n C l i c k   e v e n t   o n   h i n t   [ L o a d i n g . . . ]  
 f u n c t i o n   c a n c e l L o a d ( ) {  
 	 h i d e B e i n g L o a d e d N o d e ( ) ;  
 	 / / C h e c k   w h e t h e r   i t s   t o p   c o n t a i n e r   n o d e  
 	 i f   ( b e i n g L o a d e d N o d e . c h i l d N o d e s . l e n g t h > 0 ) {  
 	 	 b e i n g L o a d e d 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 r c   =   s I m a g e P l u s ;  
 	 }  
 	 b e i n g L o a d e d N o d e   =   n u l l ; 	  
 	 r e t u r n   f a l s e ;  
 }  
  
 / / T h i s   f u n c t i o n   h a n d l e   O n C l i c k   e v e n t   o n   a c t i o n   i m a g e   ( [ + ]   o r   [ - ] ) .    
 / / A s   p a r a m e t e r   w e   p a s s   i d   o f   a s s o c i a t e d   n o d e  
 f u n c t i o n   a c t i o n O n C l i c k ( i d ) {  
 	 v a r   o N o d e   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
 	  
 	 / / I f   n o d e   i s   a l r e a d y   e x p a n d e d   w e   c o l l a p s e   i t  
 	 i f   ( o N o d e . g e t A t t r i b u t e ( " E x p a n d e d " ) = = " t r u e " ) {  
 	 	 o N o d e . 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 " ;  
 	 	 o 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 r c   =   s I m a g e P l u s ;  
 	 	 o N o d e . s e t A t t r i b u t e   ( " E x p a n d e d " ,   " f a l s e " )  
 	 }  
 	 / / I f   n o d e   i s   c o l l a p s e d   w e   e x p a n d   i t  
 	 e l s e {  
 	 	 / / S h o w   m i n u s   i c o n  
 	 	 o 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 r c   =   s I m a g e M i n u s ; 	 	  
 	 	 / / I f   c h i l d r e n   n o d e s   a r e   a l r e a d y   l o a d e d ,   j u s t   e x p a n d   i t  
 	 	 i f   ( o N o d e . g e t A t t r i b u t e ( " L o a d e d C h i l d r e n " ) = = " t r u e " ) {  
 	 	 	 o N o d e . c h i l d N o d e s [ 1 ] . s t y l e . d i s p l a y   =   " b l o c k " ;  
 	 	 	 o N o d e . s e t A t t r i b u t e   ( " E x p a n d e d " ,   " t r u e " )  
 	 	 }  
 	 	   / / C h i l d r e n   n o d e s   a r e   n o t   l o a d e d   y e t ,   w e   n e e d   t o   l o a d   i t  
 	 	 e l s e {  
 	 	 	 / / I f   t h e   o t h e r   n o d e s   a r e   l o a d e d   a t   t h e   c u r r e n t   t i m e ,   w e   s h o u l d   s t o p   i t  
 	 	 	 i f   ( b e i n g L o a d e d N o d e ! = n u l l ) {  
 	 	 	 	 h i d e B e i n g L o a d e d N o d e ( ) ;  
 	 	 	 }  
 	 	 	 / / S e t   n e w   c u r r e n t   b e i n g   l o a d e d   n o d e  
 	 	 	 b e i n g L o a d e d N o d e   =   o N o d e ;  
 	 	 	 / / S h o w   l o a d i n g   n o d e  
 	 	 	 s h o w B e i n g L o a d e d N o d e ( ) ; 	 	  
 	 	 	 / / l o a d i n g   s u b t r e e  
 	 	 	 p r o c e s s L o a d i n g ( b e i n g L o a d e d N o d e . g e t A t t r i b u t e ( " s r c " ) ) ;  
 	 	 }  
 	 }  
 }  
  
 / / T h e s e   f u n c t i o n s   h a n d l e   o n M o u s e O v e r   a n d   o n M o u s e O u t   e v e n t s   o n   t h e   l i n k s   o f   t r e e   m e n u    
 v a r   s N o r m a l C o l o r   =   " w h i t e " ;  
 v a r   s O v e r C o l o r   =   " r e d " ;  
  
 f u n c t i o n   a c t i o n O n M o u s e O v e r ( ) {  
 	 v a r   o S r c   =   w i n d o w . e v e n t . s r c E l e m e n t ;  
 	 o S r c . s t y l e . c o l o r   =   s O v e r C o l o r   ;  
 	 o S r c . s t y l e . c u r s o r   =   " h a n d " ;  
 	 	  
   }  
  
 f u n c t i o n   a c t i o n O n M o u s e O u t ( ) {  
 	 v a r   o S r c   =   w i n d o w . e v e n t . s r c E l e m e n t ;  
 	  
 	 o S r c . s t y l e . c o l o r   =   s N o r m a l C o l o r ;  
 	 o S r c . s t y l e . c u r s o r   =   " d e f a u l t " ;  
  
 }  
  
 / / B u i l d   t r e e .   T h i s   f u n c t i o n   i s   c a l l e d   f r o m   h i d d e n   f r a m e   w i t h   n e w   d o w n l o a d e d   d a t a ,  
 / / w h i c h   a r e   p a s s e d   i n   o D a t a   p a r a m e t e r  
  
 f u n c t i o n   b u i l d T r e e ( o D a t a ) {  
 / / C h e c k   w h e t h e r   l o a d i n g   w a s   c a n c e l e d  
 	 i f   ( b e i n g L o a d e d N o d e ! = n u l l ) {  
 	 	 h i d e B e i n g L o a d e d N o d e ( ) ;  
 	 	 / / G e t   l i s t   o f   n o d e s 	 	  
 	 	 v a r   o N o d e s   =   o D a t a . n o d e s ;  
 	 	 i f   ( o N o d e s . l e n g t h = = 0 ) {  
 	 	 	 i f   ( b e i n g L o a d e d N o d e . c h i l d N o d e s . l e n g t h > 0 ) {  
 	 	 	 	 b e i n g L o a d e d 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 r c   =   s I m a g e N o n e ;  
 	 	 	 	 b e i n g L o a d e d 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 ] . o n c l i c k   =   n u l l ;  
 	 	 	 	  
 	 	 	 }  
 	 	 }  
 	 	 e l s e {  
 	 	 	 v a r   o L I ,   o U L ,   o I M G ,   o A ,   o T e x t ,   o N O B R ,   i ;  
 	 	 	 v a r   s I c o n ,   s N a m e ,   s H r e f ,   s T a r g e t ,   s S r c ,   s I d ;  
 	 	 	  
 	 	 	 / / C r e a t e   c o n t a i n e r   f o r   c h i l d   n o d e s  
 	 	 	 o U L   =   b e i n g L o a d e d N o d e . 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 E l e m e n t ( " u l " ) ) ; 	  
 	 	 	 o U L . s t y l e . d i s p l a y = " b l o c k " ; 	  
 	 	 	 / / R u n   o v e r   n o d e s  
 	 	 	  
 	 	 	 f o r   ( i = 0 ; i < o N o d e s . l e n g t h ; i + + ) {  
 	 	 	 	 / / S e t   o b l i g a t o r y   v a l u e s  
 	 	 	 	 s I c o n   =   o N o d e s [ i ] . i c o n ;  
 	 	 	 	 s N a m e   = 	 o N o d e s [ i ] . n a m e ; 	  
  
 	 	 	 	 s I d   =   o N o d e s [ i ] . i d ;  
 	 	 	 	 i f   ( s I d   = =   c I d ) {  
 	 	 	 	 	 s N a m e   =   s N a m e   +   "   » "   ;  
 	 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 / / S e t   o p t i o n a l   v a l u e s  
 	 	 	 	 i f   ( o N o d e s [ i ] . h r e f ! =   n u l l ) {  
 	 	 	 	 	 s H r e f = o N o d e s [ i ] . h r e f ; 	 	 	  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 s H r e f = " " ; 	 	 	 	 	  
 	 	 	 	 }  
 	 	 	 	 i f   ( o N o d e s [ i ] . t a r g e t ! = n u l l ) {  
 	 	 	 	 	 s T a r g e t = o N o d e s [ i ] . t a r g e t ;  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 s T a r g e t = " "  
 	 	 	 	 }  
 	 	 	 	 / / C r e a t e   n o d e  
 	 	 	 	 o L I   =   o U L . 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 E l e m e n t ( " l i " ) ) ; 	  
 	 	 	 	 / / I n c e r e m e n t   u n i q u e   n o d e   I D  
 	 	 	 	 n o d e I d + + ;  
 	 	 	 	 o L I . i d   =   ' t n '   +   n o d e I d ;  
  
 	 	 	 	 / / I f   s r c   a t t r i b u t e   i s   n o t   e m p t y ,   a d d   c u s t o m   a t t r i b u t e   t o   t h e   r e s u l t   n o d e  
 	 	 	 	 i f   ( o N o d e s [ i ] . s r c ! = n u l l ) {  
 	 	 	 	 	 s S r c   =   o N o d e s [ i ] . s r c ;  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 s S r c   =   " " ;  
 	 	 	 	 }  
 	 	 	 	 o L I . s e t A t t r i b u t e ( " s r c " ,   s S r c ) ;  
 	 	 	 	 o N O B R   =   o L I . 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 E l e m e n t ( " n o b r " ) ) ;  
 	 	 	 	 / / C r e a t e   a c t i o n   i m a g e   [ + ] ,   [ - ]   [   ]  
 	 	 	 	 o I M G   =   d o c u m e n t . c r e a t e E l e m e n t ( " i m g " ) ;  
 	 	 	 	 o I M G . b o r d e r   =   0 ;  
 	 	 	 	 / / I f   s r c   a t t r i b u t e   i s   n o t   e m p t y   o r   a m o u n t   o f   t h e   c h i l d   n o d e s   i s   n o t   e q u a l s   z e r o  
 	 	 	 	 i f   ( s S r c ! = " " ) {  
 	 	 	 	 	 / / S u b   n o d e s   w a s   n o t   l o a d e d   a n d   s o   n o t   e x p a n d e d  
 	 	 	 	 	 o L I . s e t A t t r i b u t e ( " L o a d e d C h i l d r e n " ,   " f a l s e " ) ;  
 	 	 	 	 	 o L I . s e t A t t r i b u t e ( " E x p a n d e d " ,   " f a l s e " ) ;  
 	 	 	 	 	 o I M G . s r c   =   s I m a g e P l u s ;  
 	 	 	 	 	 / / S e t   a c t i o n   i m a g e   e v e n t   h a n d l e r   -   d y n a m i c a l y   a s s e m b l y   h a n d l e r   f o r  
 	 	 	 	 	 / / I t   s h o u l d   b e   l i k e   a c t i o n O n C l i c k ( ' t n X X X X ' ) 	 	  
 	 	 	 	 	 o I M G . o n c l i c k   =   n e w   F u n c t i o n ( " a c t i o n O n C l i c k ( ' t n "   +   n o d e I d   +   " ' ) " ) ; 	  
 	 	 	 	 } 	 	  
 	 	 	 	 e l s e {  
 	 	 	 	 	 o I M G . s r c   =   s I m a g e N o n e ;  
 	 	 	 	 }  
 	 	 	 	 / / C r e a t e   i c o n   i m a g e  
 	 	 	 	 o I M G . w i d t h   =   1 6 ;  
 	 	 	 	 o I M G . h e i g h t   =   1 6 ;  
 	 	 	 	 o I M G   =   o N O B R . a p p e n d C h i l d ( o I M G ) ; 	 	  
 	 	 	 	 / / C r e a t i o n   o f   i c o n   i m a g e  
 	 	 	 	 o I M G   =   d o c u m e n t . c r e a t e E l e m e n t ( " i m g " ) ;  
 	 	 	 	 / / o I M G . b o r d e r   =   0 ;  
 	 	 	 	 / / o I M G . s r c   =   s I m a g e s P a t h   +   s I c o n   +   " . g i f " ;  
 	 	 	 	 / / o I M G . w i d t h   =   1 6 ;  
 	 	 	 	 / / o I M G . h e i g h t   =   1 6 ; 	 	  
 	 	 	 	 / / o I M G   =   o N O B R . a p p e n d C h i l d ( o I M G ) ;  
 	 	 	 	 / / C r e a t e   l i n k  
 	 	 	 	 	 	 	 	  
 	 	 	 	 o A   =   d o c u m e n t . c r e a t e E l e m e n t ( " a " ) ;  
 	 	 	 	 	 o A . o n c l i c k   =   n e w   F u n c t i o n ( " a c t i o n O n C l i c k ( ' t n "   +   n o d e I d   +   " ' ) " ) ;  
 	 	 	 	 	 o A . o n m o u s e o v e r   =   n e w   F u n c t i o n ( " a c t i o n O n M o u s e O v e r ( ) " ) ;  
 	 	 	 	 	 o A . o n m o u s e o u t   =     n e w   F u n c t i o n ( " a c t i o n O n M o u s e O u t ( ) " ) ;  
 	 	 	 	 i f   ( s H r e f ! = " " ) {  
 	 	 	 	 	 / / C o m b i n e   f u l l   p a t h   f r o m   b a s e H r e f   a n d   r e l a t i v e   p a t h  
 	 	 	 	 	 / / I f   y o u   w a n t   t o   u s e   f u l l   p a t h e s   ( n o t   r e l a t i v e )   j u s t  
 	 	 	 	 	 / / a s s i n g   t o   b a s e H r e f   e m p t y   s t r i n g  
 	 	 	 	 	 	 	 	 	 	 	 	 	 	  
 	 	 	 	 	 o A . h r e f   =   o D a t a . b a s e H r e f   +   s H r e f ;  
 	 	 	 	 }  
 	 	 	 	 i f   ( s T a r g e t ! = " " ) {  
 	 	 	 	 	 o A . t a r g e t   =   s T a r g e t ; 	 	  
 	 	 	 	 }  
 	 	 	 	 o A . t i t l e   =   s N a m e ; 	 	  
 	 	 	 	 o A . c l a s s N a m e   =   " t r e e n o d e " ;  
 	 	 	 	 o A   =   o N O B R . a p p e n d C h i l d ( o A ) ;  
  
 	 	 	 	 o T e x t   =   o A . 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 ( s N a m e ) ) ;  
 	 	 	 	  
 	 	 	 }  
 	 	 	 / / A d d   c u s t o m   a t t r i b u t e s   t o   r e s u l t N o d e   w h i c h   s p e c i f i e s   w h e t h e r   n o d e   l o a d e d   c h i l d r e n   o r   n o t   a n d    
 	 	 	 / / w h e t h e r   i s   w a s   e x p a n d e d   o r   n o t  
 	 	 	 b e i n g L o a d e d N o d e . s e t A t t r i b u t e ( " E x p a n d e d " ,   " t r u e " ) ; 	  
 	 	 }  
 	 	 b e i n g L o a d e d N o d e . s e t A t t r i b u t e ( " L o a d e d C h i l d r e n " ,   " t r u e " )  
 	 	 b e i n g L o a d e d N o d e   =   n u l l ;  
 	 }  
 	  
 	 i f   ( n I D   >   0 ) {  
 	 	 b e i n g L o a d e d N o d e   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t n "   +   n I D ) ;  
 	 	 b e i n g L o a d e d N o d e . s e t A t t r i b u t e ( " E x p a n d e d " ,   " f a l s e " ) ;  
 	 	 a c t i o n O n C l i c k ( " t n "   +   n I D ) ;  
 	 	 } 	  
  
 } 	 	  
 
