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