ÿþf u n c t i o n   a d d T o p i c N o d e ( p a r e n t N o d e I d )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' n e w T o p i c P a r e n t ' ) . v a l u e   =   p a r e n t N o d e I d ;  
  
         v a r   n e w T o p i c C o n t a i n e r   =   f a l s e ;  
         n e w T o p i c C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' n e w T o p i c C o n t a i n e r _ '   +   p a r e n t N o d e I d ) ;  
         i f   ( n e w T o p i c C o n t a i n e r )  
                 n e w T o p i c C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
 }  
  
 f u n c t i o n   c a n c e l A d d i n g T o p i c ( t o p i c I d )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' n e w T o p i c P a r e n t ' ) . v a l u e   =   ' ' ;  
          
         v a r   n e w T o p i c C o n t a i n e r   =   f a l s e ;  
         n e w T o p i c C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' n e w T o p i c C o n t a i n e r _ '   +   t o p i c I d ) ;  
         i f   ( n e w T o p i c C o n t a i n e r )  
                 n e w T o p i c C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
 }  
  
 f u n c t i o n   e d i t T o p i c N a m e ( t o p i c I d ,   t o p i c N a m e )  
 {  
         / /    540:B8@>20=85  =08<5=>20=8O  B>?8:0 
         v a r   e d i t T o p i c N a m e C o n t a i n e r   =   f a l s e ;  
         e d i t T o p i c N a m e C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t T o p i c N a m e C o n t a i n e r ' ) ;  
         i f   ( e d i t T o p i c N a m e C o n t a i n e r )  
         {  
                 / / v a r   b t n   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t T o p i c N a m e B u t t o n _ '   +   t o p i c I d ) ;  
                 v a r   t o p i c A n c h o r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' t o p i c A n c h o r '   +   t o p i c I d ) ;  
                  
                 e d i t T o p i c N a m e C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
                 e d i t T o p i c N a m e C o n t a i n e r . s t y l e [ ' p o s i t i o n ' ]   =   ' a b s o l u t e ' ;  
                  
                 e d i t T o p i c N a m e C o n t a i n e r . s t y l e [ ' t o p ' ]   =   t o p i c A n c h o r . o f f s e t T o p   +   2 0 0   +   ' p x ' ;  
                 e d i t T o p i c N a m e C o n t a i n e r . s t y l e [ ' l e f t ' ]   =   t o p i c A n c h o r . o f f s e t L e f t   +   ' p x ' ;  
         }  
          
         / /   #AB0=02;8205<  845=B8D8:0B>@  B>?8:0  2  A:@KBK9  8=?CB 
         d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t e d T o p i c I d ' ) . v a l u e   =   t o p i c I d ;  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t T o p i c N a m e ' ) . 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 ( ' t o p i c N a m e '   +   t o p i c I d ) . v a l u e ;  
 }  
  
 f u n c t i o n   c a n c e l E d i t T o p i c N a m e ( )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t T o p i c N a m e C o n t a i n e r ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;          
 }  
  
 f u n c t i o n   e d i t P r e a m b l e ( )  
 {  
         v a r   n e w P r e a m b l e T e x t   =   f a l s e ;  
         n e w P r e a m b l 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 ( ' n e w P r e a m b l e T e x t ' ) ;  
         i f   ( n e w P r e a m b l 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 ( ' p r e a m b l e E d i t B o x ' ) . 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 ( ' p r e a m b l e V i e w B o x ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
                  
                 n e w P r e a m b l e T e x t . i n n e r H T M L   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' p r e a m b l e T e x t ' ) . i n n e r H T M L . r e p l a c e ( / < b r \ / > / g i ,   ' \ n ' ) . r e p l a c e ( / < b r > / g i ,   ' \ n ' ) ;  
         }  
 }  
  
 f u n c t i o n   c a n c e l E d i t P r e a m b l e ( )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' p r e a m b l e E d i t B o x ' ) . 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 ( ' p r e a m b l e V i e w B o x ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
 }  
  
 f u n c t i o n   c a n c e l A d d i n g Q u e s t i o n ( )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' a d d Q u e s t i o n B u t t o n ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' i n l i n e ' ;  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' q u e s t i o n A d d B o x ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
 }  
  
 f u n c t i o n   s t a r t A d d i n g Q u e s t i o n ( )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' q u e s t i o n A d d B o x ' ) . 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 d d Q u e s t i o n B u t t o n ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
 }  
  
 f u n c t i o n   s t a r t I n l i n e E d i t Q u e s t i o n ( q u e s t i o n I d ,   t o p i c I d )  
 {  
         / /    540:B8@>20=85  2>?@>A0  " =0  <5AB5"  
         v a r   p a r a g r a p h   =   f a l s e ;  
         p a r a g r a p h   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' q u e s t i o n P a r a g r a p h '   +   q u e s t i o n I d ) ;  
         i f   ( p a r a g r a p h )  
         {  
                 v a r   q u e s t i o n C o n t e n t s   =   p a r a g r a p h . i n n e r H T M L . r e p l a c e ( / < b r \ / > / g i ,   ' \ n ' ) . r e p l a c e ( / < b r > / g i ,   ' \ n ' ) ;  
                  
                 / / + + + + + + + + + + + + + + + + + + + + +  
                 / / a l e r t ( q u e s t i o n C o n t e n t s ) ;  
                 / / + + + + + + + + + + + + + + + + + + + + +  
                  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t L i n k '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' i n l i n e - 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 ( ' q u e s t i o n E d i t o r '   +   q u e s t i o n I d ) . 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 ( ' q u e s t i o n P a r a g r a p h '   +   q u e s t i o n I d ) . 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 ( ' q e s t i o n T e x t A r e a '   +   q u e s t i o n I d ) . i n n e r H T M L   =   q u e s t i o n C o n t e n t s ;  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' q e s t i o n T e x t A r e a '   +   q u e s t i o n I d ) . v a l u e   =   q u e s t i o n C o n t e n t s ;  
         }  
 }  
  
 f u n c t i o n   g e t B o d y S c r o l l T o p ( )  
 {  
     r e t u r n   s e l f . p a g e Y O f f s e t   | |   ( d o c u m e n t . d o c u m e n t E l e m e n t   & &   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p )   | |   ( d o c u m e n t . b o d y   & &   d o c u m e n t . b o d y . s c r o l l T o p ) ;  
 }  
  
 f u n c t i o n   c l o s e I n P l a c e E d i t o r ( q u e s t i o n I d )  
 {  
         / /   B<5=0  @540:B8@>20=8O  2>?@>A0  " =0  <5AB5"  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t L i n k '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' i n l i n e - 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 ( ' q u e s t i o n E d i t o r '   +   q u e s t i o n I d ) . 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 ( ' q e s t i o n T e x t A r e a '   +   q u e s t i o n I d ) . i n n e r H T M L   =   ' ' ;  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' q u e s t i o n P a r a g r a p h '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
 }  
  
 f u n c t i o n   s h o w N e w Q u e s t i o n F o r m ( t y p e )  
 {  
         / /   !:@K205<  1;>:8  @540:B8@>20=8O  2A5E  B8?>2  2>?@>A>2 
         d o c u m e n t . g e t E l e m e n t B y I d ( ' b o l d E d i t B o x ' ) . 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 ( ' p l a i n E d i t B o x ' ) . 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 ( ' t a b l e E d i t B o x ' ) . 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 p a c e r E d i t B o x ' ) . 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 ( ' i m a g e E d i t B o x ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
          
         / /   B>1@065=85  =C6=>3>  1;>:0 
         d o c u m e n t . g e t E l e m e n t B y I d ( t y p e   +   ' E d i t B o x ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
 }  
  
 f u n c t i o n   g e n e r a t e T a b l e ( )  
 {  
         v a r   n e w Q u e s t i o n T a b l e   =   f a l s e ;  
         v a r   r o w s C o u n t   =   f a l s e ;  
          
         n e w Q u e s t i o n T a b l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' d y n T a b l e ' ) ;  
         r o w s C o u 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 a b l e R o w s C o u n t ' ) . v a l u e ;  
          
         i f   ( n e w Q u e s t i o n T a b l e   & &   r o w s C o u n t )  
         {  
                 / /    07@CH5=85  B01;8FK 
                 f o r   ( i = n e w Q u e s t i o n T a b l e . r o w s . l e n g t h ;   i > 0 ;   i - - )  
                         n e w Q u e s t i o n T a b l e . d e l e t e R o w ( i - 1 ) ;  
          
                 / /   >102;5=85  @O4>2  ?>  425  :>;>=:8  2  :064>< 
                 f o r   ( i = 0 ;   i < r o w s C o u n t ;   i + + )  
                 {  
                         r o w   =   n e w Q u e s t i o n T a b l e . i n s e r t R o w ( i ) ;  
                         c e l l 1   =   r o w . i n s e r t C e l l ( 0 ) ;  
                         c e l l 2   =   r o w . i n s e r t C e l l ( 1 ) ;  
                          
                         c e l l 1 . i n n e r H T M L   =   ' < t e x t a r e a   r o w s = " 5 "   c o l s = " 3 0 "   n a m e = " r '   +   i   +   ' c 1 " > < / t e x t a r e a > ' ;  
                         c e l l 2 . i n n e r H T M L   =   ' < t e x t a r e a   r o w s = " 5 "   c o l s = " 3 0 "   n a m e = " r '   +   i   +   ' c 2 " > < / t e x t a r e a > ' ;  
                 }  
         }  
 }  
  
 f u n c t i o n   c r e a t e M a s k ( o p a c i t y )  
 {  
         v a r   m a s k   =   d o c u m e n t . c r e a t e E l e m e n t ( ' d i v ' ) ;  
         m a s k . i d   =   ' m a s k D i v ' ;  
          
         / / v a r   m a s k   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m a s k D i v ' ) ;  
         m a s k . s t y l e [ ' b a c k g r o u n d ' ]   =   ' r g b ( 1 8 0 ,   1 8 0 ,   1 8 0 ) ' ;  
         m a s k . s t y l e [ ' p o s i t i o n ' ]   =   ' a b s o l u t e ' ;  
         m a s k . s t y l e [ ' t o p ' ]   =   ' 0 ' ;  
         m a s k . s t y l e [ ' l e f t ' ]   =   ' 0 ' ;  
         m a s k . s t y l e [ ' m a r g i n ' ]   =   ' 0 ' ;  
         m a s k . s t y l e [ ' z - i n d e x ' ]   =   5 ;  
          
         v a r   s c r o l l T o p   =   g e t B o d y S c r o l l T o p ( ) ;    
                  
         v a r   w w   =   e v a l ( ( d o c u m e n t . b o d y . s c r o l l W i d t h   >   d o c u m e n t . b o d y . o f f s e t W i d t h )   ?   d o c u m e n t . b o d y . s c r o l l W i d t h   :   d o c u m e n t . b o d y . o f f s e t W i d t h )   +   ' p x ' ;  
         m a s k . s t y l e [ ' w i d t h ' ]   =   w w ;  
         v a r   h h   =   e v a l ( ( s c r o l l T o p   >   d o c u m e n t . b o d y . o f f s e t H e i g h t )   ?   d o c u m e n t . b o d y . o f f s e t H e i g h t   :   d o c u m e n t . b o d y . o f f s e t H e i g h t )   +   ' p x ' ;  
         m a s k . s t y l e [ ' h e i g h t ' ]   =   h h ;  
          
         / / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  
         / *          
         c o n s o l e . d e b u g ( ' d o c u m e n t . b o d y . o f f s e t H e i g h t ' ,   d o c u m e n t . b o d y . o f f s e t H e i g h t ) ;  
         c o n s o l e . d e b u g ( ' d o c u m e n t . b o d y . s c r o l l H e i g h t ' ,   d o c u m e n t . b o d y . s c r o l l H e i g h t ) ;  
         c o n s o l e . d e b u g ( ' d o c u m e n t . b o d y . s c r o l l T o p ' ,   s c r o l l T o p ) ;  
         c o n s o l e . d e b u g ( ' h h ' ,   h h ) ;  
         * /  
         / / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  
                  
         m a s k . s t y l e [ ' o v e r f l o w ' ]   =   ' h i d d e n ' ;  
         m a s k . s t y l e [ ' o p a c i t y ' ]   =   e v a l ( ' 0 . '   +   o p a c i t y ) ;  
         m a s k . s t y l e . f i l t e r   =   ' a l p h a ( o p a c i t y = '   +   o p a c i t y   +   ' ) ' ;  
         d o c u m e n t . b o d y . a p p e n d C h i l d ( m a s k ) ;  
 }  
  
 f u n c t i o n   a d d V o t e ( q u e s t i o n I d )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' a d d V o t e B u t t o n '   +   q u e s t i o n I d ) . 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 ( ' v o t e S e l e c t o r C o n t a i n e r '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' i n l i n e - b l o c k ' ;  
 }  
  
 f u n c t i o n   c a n c e l A d d V o t e ( q u e s t i o n I d )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' a d d V o t e B u t t o n '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' i n l i n e - 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 ( ' v o t e S e l e c t o r C o n t a i n e r '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
 }  
  
 f u n c t i o n   m o u s e P a g e X Y ( e )  
 {  
     v a r   x   =   0 ,   y   =   0 ;  
  
     i f   ( ! e )   e   =   w i n d o w . e v e n t ;  
  
     i f   ( e . p a g e X   | |   e . p a g e Y )  
     {  
         x   =   e . p a g e X ;  
         y   =   e . p a g e Y ;  
     }  
     e l s e   i f   ( e . c l i e n t X   | |   e . c l i e n t Y )  
     {  
         x   =   e . c l i e n t X   +   ( d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t   | |   d o c u m e n t . b o d y . s c r o l l L e f t )   -   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t L e f t ;  
         y   =   e . c l i e n t Y   +   ( d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p   | |   d o c u m e n t . b o d y . s c r o l l T o p )   -   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t T o p ;  
     }  
  
     r e t u r n   { " x " : x ,   " y " : y } ;  
 }  
  
 f u n c t i o n   g e t E l e m e n t P o s i t i o n ( e l e m )  
 {  
         / / v a r   e l e m   =   d o c u m e n t . g e t E l e m e n t B y I d ( e l e m I d ) ;  
 	  
         v a r   w   =   e l e m . o f f s e t W i d t h ;  
         v a r   h   =   e l e m . o f f s e t H e i g h t ;  
 	  
         v a r   l   =   0 ;  
         v a r   t   =   0 ;  
 	  
         w h i l e   ( e l e m )  
         {  
                 l   + =   e l e m . o f f s e t L e f t ;  
                 t   + =   e l e m . o f f s e t T o p ;  
                 e l e m   =   e l e m . o f f s e t P a r e n t ;  
         }  
  
         r e t u r n   { " l e f t " : l ,   " t o p " : t ,   " w i d t h " :   w ,   " h e i g h t " : h } ;  
 }  
  
 f u n c t i o n   a r r a n g e C h e c k b o x e s ( i s A d m i n )  
 / /   B:;NG5=85  2:;NG5=85  G5:1>:A>2  4>ABC?0  :  @0745;0<.   A?>;L7C5BAO  4;O  O2=>9  CAB0=>2:8  ?@02  04<8=8AB@0B>@0 
 {  
         v a r   c h e c k B o x e s   =   d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' i n p u t ' ) ;  
  
         f o r   ( i = 0 ;   i < c h e c k B o x e s . l e n g t h ;   i + + )  
                 i f   ( c h e c k B o x e s [ i ] . g e t A t t r i b u t e ( ' t y p e ' )   & &   c h e c k B o x e s [ i ] . g e t A t t r i b u t e ( ' t y p e ' )   = =   ' c h e c k b o x ' )  
                         i s A d m i n   ?   c h e c k B o x e s [ i ] . s e t A t t r i b u t e ( ' d i s a b l e d ' ,   i s A d m i n )   :   c h e c k B o x e s [ i ] . r e m o v e A t t r i b u t e ( ' d i s a b l e d ' ) ;  
 }    
  
 f u n c t i o n   m o v e T o p i c ( t o p i c I d )  
 {  
         / /   5@5<5I5=85  B5<0B8:8  ?>  45@52C 
         v a r   m o v e T o p i c C o n t a i n e r   =   f a l s e ;  
         m o v e T o p i c C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m o v e T o p i c C o n t a i n e r ' ) ;  
         i f   ( m o v e T o p i c C o n t a i n e r )  
         {  
                 v a r   t o p i c A n c h o r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' t o p i c A n c h o r '   +   t o p i c I d ) ;  
                  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' p o s i t i o n ' ]   =   ' a b s o l u t e ' ;  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' t o p ' ]   =   t o p i c A n c h o r . o f f s e t T o p   +   2 0 0   +   ' p x ' ;  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' l e f t ' ]   =   t o p i c A n c h o r . o f f s e t L e f t   +   ' p x ' ;  
         }  
          
         / /   #AB0=02;8205<  845=B8D8:0B>@  B>?8:0  2  A:@KBK9  8=?CB 
         d o c u m e n t . g e t E l e m e n t B y I d ( ' m o v e d T o p i c I d ' ) . v a l u e   =   t o p i c I d ;  
         / / d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t T o p i c N a m e ' ) . v a l u e   =   t o p i c N a m e ;  
 }  
  
 f u n c t i o n   c a n c e l M o v e T o p i c ( )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' m o v e T o p i c C o n t a i n e r ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;          
 }  
  
 f u n c t i o n   s o r t T o p i c ( t o p i c I d )  
 {  
         / /   5@5<5I5=85  B5<0B8:8  ?>  45@52C 
         v a r   m o v e T o p i c C o n t a i n e r   =   f a l s e ;  
         m o v e T o p i c C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' s o r t T o p i c C o n t a i n e r ' ) ;  
         i f   ( m o v e T o p i c C o n t a i n e r )  
         {  
                 v a r   t o p i c A n c h o r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' t o p i c A n c h o r '   +   t o p i c I d ) ;  
                  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' p o s i t i o n ' ]   =   ' a b s o l u t e ' ;  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' t o p ' ]   =   t o p i c A n c h o r . o f f s e t T o p   +   2 0 0   +   ' p x ' ;  
                 m o v e T o p i c C o n t a i n e r . s t y l e [ ' l e f t ' ]   =   t o p i c A n c h o r . o f f s e t L e f t   +   ' p x ' ;  
         }  
          
         / /   #AB0=02;8205<  845=B8D8:0B>@  B>?8:0  2  A:@KBK9  8=?CB 
         d o c u m e n t . g e t E l e m e n t B y I d ( ' s o r t e d T o p i c I d ' ) . v a l u e   =   t o p i c I d ;  
         / / d o c u m e n t . g e t E l e m e n t B y I d ( ' e d i t T o p i c N a m e ' ) . v a l u e   =   t o p i c N a m e ;  
 }  
  
 f u n c t i o n   c a n c e l S o r t T o p i c ( )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' s o r t T o p i c C o n t a i n e r ' ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;          
 }  
  
 f u n c t i o n   s t a r t S o r t i n g Q u e s t i o n ( q u e s t i o n I d ,   t o p i c I d )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' q u e s t i o n S o r t e r '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' i n l i n e - 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 ( ' s o r t L i n k '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
 }  
  
 f u n c t i o n   c l o s e I n P l a c e S o r t e r ( q u e s t i o n I d )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' q u e s t i o n S o r t e r '   +   q u e s t i o n I d ) . 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 o r t L i n k '   +   q u e s t i o n I d ) . s t y l e [ ' d i s p l a y ' ]   =   ' i n l i n e - b l o c k ' ;  
 }  
  
 f u n c t i o n   s h o w H i d e C h i l d r e n T o p i c s ( t o p i c I d )  
 {  
         / /   B>1@065=85/ A:@KB85  4>G5@=8E  M;5<5=B>2 
         v a r   c h i l d r e n C o n t a i n e r   =   f a l s e ;  
         v a r   o p e n e r I m a g e O b j   =   f a l s e ;  
          
         c h i l d r e n C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c h i l d '   +   t o p i c I d   +   ' c o n t a i n e r ' ) ;  
         o p e n e r I m a g e O b j   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c h i l d '   +   t o p i c I d   +   ' o p e n e r ' ) ;  
          
         i f   ( c h i l d r e n C o n t a i n e r   & &   c h i l d r e n C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   = =   ' n o n e ' )  
         {  
                 c h i l d r e n C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' b l o c k ' ;  
                 o p e n e r I m a g e O b j . s r c   =   m i n u s I m g . s r c ;  
         }  
         e l s e   i f   ( c h i l d r e n C o n t a i n e r   & &   c h i l d r e n C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   = =   ' b l o c k ' )  
         {  
                 c h i l d r e n C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
                 o p e n e r I m a g e O b j . s r c   =   p l u s I m g . s r c ;  
         }  
          
         / /   * * * * *   >ABK;L  4;O  I E .   A?@02;5=85  ?>78F8>=8@>20=8O  ?>420;0  * * * * *  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' f o o t e r ' ) . s t y l e [ ' p o s i t i o n ' ]   =   ' a b s o l u t e ' ;  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' f o o t e r ' ) . s t y l e [ ' p o s i t i o n ' ]   =   ' r e l a t i v e ' ;  
          
          
 }  
  
 f u n c t i o n   s h o w H i d e T o o l b o x ( t o p i c I d )  
 {  
         / /   B>1@065=85/ A:@KB85  4>G5@=8E  M;5<5=B>2 
         v a r   t o o l b o x C o n t a i n e r   =   f a l s e ;  
         t o o l b o x C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' t o o l b o x C o n t a i n e r '   +   t o p i c I d ) ;  
          
         i f   ( t o o l b o x C o n t a i n e r   & &   t o o l b o x C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   = =   ' n o n e ' )  
                 t o o l b o x C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' t a b l e - r o w ' ;  
         e l s e   i f   ( t o o l b o x C o n t a i n e r   & &   t o o l b o x C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   = =   ' t a b l e - r o w ' )  
                 t o o l b o x C o n t a i n e r . s t y l e [ ' d i s p l a y ' ]   =   ' n o n e ' ;  
 }  
 
