ÿþ/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
   *   o p e n W Y S I W Y G   v 1 . 4 7   C o p y r i g h t   ( c )   2 0 0 6   o p e n W e b W a r e . c o m    
   *   C o n t a c t   u s   a t   d e v s @ o p e n w e b w a r e . c o m  
   *   T h i s   c o p y r i g h t   n o t i c e   M U S T   s t a y   i n t a c t   f o r   u s e .  
   *  
   *   $ I d :   w y s i w y g . j s , v   1 . 2 2   2 0 0 7 / 0 9 / 0 8   2 1 : 4 5 : 5 7   x h a g g i   E x p   $  
   *   $ R e v i s i o n :   1 . 2 2   $  
   *  
   *   A n   o p e n   s o u r c e   W Y S I W Y G   e d i t o r   f o r   u s e   i n   w e b   b a s e d   a p p l i c a t i o n s .  
   *   F o r   f u l l   s o u r c e   c o d e   a n d   d o c s ,   v i s i t   h t t p : / / w w w . o p e n w e b w a r e . c o m  
   *  
   *   T h i s   l i b r a r y   i s   f r e e   s o f t w a r e ;   y o u   c a n   r e d i s t r i b u t e   i t   a n d / o r   m o d i f y    
   *   i t   u n d e r   t h e   t e r m s   o f   t h e   G N U   L e s s e r   G e n e r a l   P u b l i c   L i c e n s e   a s   p u b l i s h e d    
   *   b y   t h e   F r e e   S o f t w a r e   F o u n d a t i o n ;   e i t h e r   v e r s i o n   2 . 1   o f   t h e   L i c e n s e ,   o r    
   *   ( a t   y o u r   o p t i o n )   a n y   l a t e r   v e r s i o n .  
   *  
   *   T h i s   l i b r a r y   i s   d i s t r i b u t e d   i n   t h e   h o p e   t h a t   i t   w i l l   b e   u s e f u l ,   b u t    
   *   W I T H O U T   A N Y   W A R R A N T Y ;   w i t h o u t   e v e n   t h e   i m p l i e d   w a r r a n t y   o f   M E R C H A N T A B I L I T Y    
   *   o r   F I T N E S S   F O R   A   P A R T I C U L A R   P U R P O S E .   S e e   t h e   G N U   L e s s e r   G e n e r a l   P u b l i c    
   *   L i c e n s e   f o r   m o r e   d e t a i l s .  
   *  
   *   Y o u   s h o u l d   h a v e   r e c e i v e d   a   c o p y   o f   t h e   G N U   L e s s e r   G e n e r a l   P u b l i c   L i c e n s e   a l o n g    
   *   w i t h   t h i s   l i b r a r y ;   i f   n o t ,   w r i t e   t o   t h e   F r e e   S o f t w a r e   F o u n d a t i o n ,   I n c . ,   5 9    
   *   T e m p l e   P l a c e ,   S u i t e   3 3 0 ,   B o s t o n ,   M A   0 2 1 1 1 - 1 3 0 7   U S A      
   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 v a r   W Y S I W Y G   =   {  
  
 	 / * *  
 	   *   S e t t i n g s   c l a s s ,   h o l d s   a l l   c u s t o m i z e a b l e   p r o p e r t i e s  
 	   * /  
 	 S e t t i n g s :   f u n c t i o n ( )   {  
 	  
 	 	 / /   I m a g e s   D i r e c t o r y  
 	 	 t h i s . I m a g e s D i r   =   " . . / j a v a l a r / r i c h t e x t / i m a g e s / " ;  
 	 	  
 	 	 / /   P o p u p s   D i r e c t o r y  
 	 	 t h i s . P o p u p s D i r   =   " . . / j a v a l a r / r i c h t e x t / p o p u p s / " ;  
 	 	  
 	 	 / /   C S S   D i r e c t o r y   F i l e  
 	 	 t h i s . C S S F i l e   =   " . . / j a v a l a r / r i c h t e x t / s t y l e s / w y s i w y g . c s s " ; 	 	  
 	 	  
 	 	 / /   D e f a u l t   W Y S I W Y G   w i d t h   a n d   h e i g h t   ( u s e   p x   o r   % )  
 	 	 t h i s . W i d t h   =   " 1 0 0 % " ;  
 	 	 t h i s . H e i g h t   =   " 4 8 0 p x " ;  
 	 	  
 	 	 / /   D e f a u l t   s t y l e s h e e t   o f   t h e   W Y S I W Y G   e d i t o r   w i n d o w  
 	 	 t h i s . D e f a u l t S t y l e   =   " f o n t - f a m i l y :   A r i a l ;   f o n t - s i z e :   1 2 p x ;   b a c k g r o u n d - c o l o r :   # F F F F F F " ;  
 	 	  
 	 	 / /   S t y l e s h e e t   i f   e d i t o r   i s   d i s a b l e d  
 	 	 t h i s . D i s a b l e d S t y l e   =   " f o n t - f a m i l y :   A r i a l ;   f o n t - s i z e :   1 2 p x ;   b a c k g r o u n d - c o l o r :   # F F F F F F " ;  
 	 	 	 	  
 	 	 / /   W i d t h   +   H e i g h t   o f   t h e   p r e v i e w   w i n d o w  
 	 	 t h i s . P r e v i e w W i d t h   =   5 0 0 ;  
 	 	 t h i s . P r e v i e w H e i g h t   =   4 0 0 ;  
 	 	  
 	 	 / /   C o n f i r m a t i o n   m e s s a g e   i f   y o u   s t r i p   a n y   H T M L   a d d e d   b y   w o r d  
 	 	 t h i s . R e m o v e F o r m a t C o n f M e s s a g e   =   " W o r d   t a r a f ý n d a n   e k l n e n   k o d l a r   t e m i z l e n m e s i n i   i s t e r   m i s i n i z ? " ;  
 	 	  
 	 	 / /   N o f i c a t i o n   i f   b r o w s e r   i s   n o t   s u p p o r t e d   b y   o p e n W Y S I W Y G ,   l e a v e   i t   b l a n k   f o r   n o   m e s s a g e   o u t p u t .  
 	 	 t h i s . N o V a l i d B r o w s e r M e s s a g e   =   " B r o w s e r ý n ý z   e d i t ö r ü   d e s t e k l e m i y o r . " ;  
 	 	 	 	  
 	 	 / /   A n c h o r   p a t h   t o   s t r i p ,   l e a v e   i t   b l a n k   t o   i g n o r e  
 	 	 / /   o r   d e f i n e   a u t o   t o   s t r i p   t h e   p a t h   w h e r e   t h e   e d i t o r   i s   p l a c e d    
 	 	 / /   ( o n l y   I E )  
 	 	 t h i s . A n c h o r P a t h T o S t r i p   =   " a u t o " ;  
 	 	  
 	 	 / /   I m a g e   p a t h   t o   s t r i p ,   l e a v e   i t   b l a n k   t o   i g n o r e  
 	 	 / /   o r   d e f i n e   a u t o   t o   s t r i p   t h e   p a t h   w h e r e   t h e   e d i t o r   i s   p l a c e d    
 	 	 / /   ( o n l y   I E )  
 	 	 t h i s . I m a g e P a t h T o S t r i p   =   " a u t o " ;  
 	 	  
 	 	 / /   E n a b l e   /   D i s a b l e   t h e   c u s t o m   c o n t e x t   m e n u  
 	 	 t h i s . C o n t e x t M e n u   =   t r u e ;  
 	 	  
 	 	 / /   E n a b l e d   t h e   s t a t u s   b a r   u p d a t e .   W i t h i n   t h e   s t a t u s   b a r    
 	 	 / /   n o d e   t r e e   o f   t h e   a c t u a l l y   s e l e c t e d   e l e m e n t   w i l l   b u i l d  
 	 	 t h i s . S t a t u s B a r E n a b l e d   =   f a l s e ;  
 	 	  
 	 	 / /   I f   e n a b l e d   t h a n   t h e   c a p a b i l i t y   o f   t h e   I E   i n s e r t i n g   l i n e   b r e a k s   w i l l   b e   i n v e r t e d .  
 	 	 / /   N o r m a l :   E N T E R   =   < p >   ,   S H I F T   +   E N T E R   =   < b r >  
 	 	 / /   I n v e r t e d :   E N T E R   =   < b r > ,   S H I F T   +   E N T E R   =   < p >  
 	 	 t h i s . I n v e r t I E L i n e B r e a k s   =   f a l s e ;  
 	 	  
 	 	 / /   R e p l a c e   l i n e   b r e a k s   w i t h   < b r >   t a g s  
 	 	 t h i s . R e p l a c e L i n e B r e a k s   =   f a l s e ;  
              
 	 	 / /   P a g e   t h a t   o p e n e d   t h e   W Y S I W Y G   ( U s e d   f o r   t h e   r e t u r n   c o m m a n d )  
 	 	 t h i s . O p e n e r   =   " a d m i n . a s p " ;  
 	 	  
 	 	 / /   I n s e r t   i m a g e   i m p l e m e n t a t i o n  
 	 	 t h i s . I m a g e P o p u p F i l e   =   " " ;  
 	 	 t h i s . I m a g e P o p u p W i d t h   =   0 ;  
 	 	 t h i s . I m a g e P o p u p H e i g h t   =   0 ;  
 	 	  
 	 	 / /   H o l d s   t h e   a v a i l a b l e   b u t t o n s   d i s p l a y e d    
 	 	 / /   o n   t h e   t o o l b a r   o f   t h e   e d i t o r  
 	 	 t h i s . T o o l b a r   =   n e w   A r r a y ( ) ;  
 	 	 t h i s . T o o l b a r [ 0 ]   =   n e w   A r r a y (  
 	 	 	 " f o n t " ,    
 	 	 	 " f o n t s i z e " ,  
 	 	 	 / / " h e a d i n g s " , 	  
 	 	 	 " b o l d " ,    
 	 	 	 " i t a l i c " ,    
 	 	 	 " u n d e r l i n e " ,    
 	 	 	 " s t r i k e t h r o u g h " ,  
 	 	 	 " s e p e r a t o r " ,    
 	 	 	 " f o r e c o l o r " ,    
 	 	 	 " b a c k c o l o r " ,    
 	 	 	 " s e p e r a t o r " ,  
 	 	 	 " j u s t i f y f u l l " ,    
 	 	 	 " j u s t i f y l e f t " ,    
 	 	 	 " j u s t i f y c e n t e r " ,    
 	 	 	 " j u s t i f y r i g h t " ,    
 	 	 	 " s e p e r a t o r " ,    
 	 	 	 " u n o r d e r e d l i s t " ,    
 	 	 	 " o r d e r e d l i s t " ,  
 	 	 	 " o u t d e n t " ,    
 	 	 	 " i n d e n t "  
 	 	 ) ;  
 	 	 t h i s . T o o l b a r [ 1 ]   =   n e w   A r r a y (  
 	 	 	 / / " s a v e " ,  
 	 	 	 / /   " r e t u r n " ,     / /   r e t u r n   b u t t o n   d i s a b l e d   b y   d e f a u l t  
 	 	 	 / / " s e p e r a t o r " ,    
 	 	 	 / / " s u b s c r i p t " ,    
 	 	 	 / / " s u p e r s c r i p t " ,    
 	 	 	 / / " s e p e r a t o r " ,    
 	 	 	 " c u t " ,    
 	 	 	 " c o p y " ,    
 	 	 	 " p a s t e " ,  
 	 	 	 " r e m o v e f o r m a t " ,  
 	 	 	 " s e p e r a t o r " ,    
 	 	 	 " u n d o " ,    
 	 	 	 " r e d o " ,    
 	 	 	 " s e p e r a t o r " ,    
 	 	 	 " i n s e r t t a b l e " ,    
 	 	 	 " i n s e r t i m a g e " ,    
 	 	 	 " c r e a t e l i n k " ,    
 	 	 	 " s e p e r a t o r " ,      
 	 	 	 " p r e v i e w " ,    
 	 	 	 " p r i n t " ,  
 	 	 	 " s e p e r a t o r " ,    
 	 	 	 " v i e w S o u r c e " ,  
 	 	 	 / / " m a x i m i z e " ,    
 	 	 	 " s e p e r a t o r " ,    
 	 	 	 " h e l p "  
 	 	 ) ;  
 	 	  
 	 	 / /   D r o p D o w n s  
 	 	 t h i s . D r o p D o w n s   =   n e w   A r r a y ( ) ;  
 	 	 / /   F o n t s  
 	 	 t h i s . D r o p D o w n s [ ' f o n t ' ]   =   {  
 	 	 	 i d :   " f o n t s " ,  
 	 	 	 c o m m a n d :   " F o n t N a m e " ,  
 	 	 	 l a b e l :   " < f o n t   s t y l e = \ " f o n t - f a m i l y : { v a l u e } ; f o n t - s i z e : 1 2 p x ; \ " > { v a l u e } < / f o n t > " ,  
 	 	 	 w i d t h :   " 9 0 p x " ,  
 	 	 	 e l e m e n t s :   n e w   A r r a y (  
 	 	 	 	 " A r i a l " ,    
 	 	 	 	 / / " S a n s   S e r i f " ,    
 	 	 	 	 " T a h o m a " ,    
 	 	 	 	 " V e r d a n a "  
 	 	 	 	 / / " C o u r i e r   N e w " ,    
 	 	 	 	 / / " G e o r g i a " ,    
 	 	 	 	 / / " T i m e s   N e w   R o m a n " ,    
 	 	 	 	 / / " I m p a c t " ,    
 	 	 	 	 / / " C o m i c   S a n s   M S "  
 	 	 	 )  
 	 	 } ;  
 	 	 / /   F o n t   s i z e s  
 	 	 t h i s . D r o p D o w n s [ ' f o n t s i z e ' ]   =   { 	  
 	 	 	 i d :   " f o n t s i z e s " ,  
 	 	 	 c o m m a n d :   " F o n t S i z e " ,  
 	 	 	 l a b e l :   " < f o n t   s i z e = \ " { v a l u e } \ " > Ö l ç ü   { v a l u e } < / f o n t > " ,  
 	 	 	 w i d t h :   " 5 4 p x " ,  
 	 	 	 e l e m e n t s :   n e w   A r r a y (  
 	 	 	 	 " 1 " ,    
 	 	 	 	 " 2 " ,    
 	 	 	 	 " 3 "  
 	 	 	 	 / / " 4 " ,    
 	 	 	 	 / / " 5 " ,    
 	 	 	 	 / / " 6 " ,    
 	 	 	 	 / / " 7 "  
 	 	 	 )  
 	 	 } ;  
 	 	 / /   H e a d i n g s  
 	 	 t h i s . D r o p D o w n s [ ' h e a d i n g s ' ]   =   { 	  
 	 	 	 i d :   " h e a d i n g s " ,  
 	 	 	 c o m m a n d :   " F o r m a t B l o c k " ,  
 	 	 	 l a b e l :   " < { v a l u e }   s t y l e = \ " m a r g i n : 0 p x ; t e x t - d e c o r a t i o n : n o n e ; f o n t - f a m i l y : A r i a l \ " > { v a l u e } < / { v a l u e } > " ,  
 	 	 	 w i d t h :   " 7 4 p x " ,  
 	 	 	 e l e m e n t s :   n e w   A r r a y (  
 	 	 	 	 " H 1 " ,    
 	 	 	 	 " H 2 " ,    
 	 	 	 	 " H 3 " ,    
 	 	 	 	 " H 4 " ,    
 	 	 	 	 " H 5 " ,    
 	 	 	 	 " H 6 "  
 	 	 	 )  
 	 	 } ;  
 	 	 	 	  
 	 	 / /   A d d   t h e   g i v e n   e l e m e n t   t o   t h e   d e f i n e d   t o o l b a r  
 	 	 / /   o n   t h e   d e f i n e d   p o s i t i o n  
 	 	 t h i s . a d d T o o l b a r E l e m e n t   =   f u n c t i o n ( e l e m e n t ,   t o o l b a r ,   p o s i t i o n )   {  
 	 	 	 i f ( e l e m e n t   ! =   " s e p e r a t o r " )   { t h i s . r e m o v e T o o l b a r E l e m e n t ( e l e m e n t ) ; }  
 	 	 	 i f ( t h i s . T o o l b a r [ t o o l b a r - 1 ]   = =   n u l l )   {  
 	 	 	 	 t h i s . T o o l b a r [ t o o l b a r - 1 ]   =   n e w   A r r a y ( ) ;  
 	 	 	 }  
 	 	 	 t h i s . T o o l b a r [ t o o l b a r - 1 ] . s p l i c e ( p o s i t i o n + 1 ,   1 ,   e l e m e n t ) ; 	 	 	  
 	 	 } ;  
 	 	  
 	 	 / /   R e m o v e   a n   e l e m e n t   f r o m   t h e   t o o l b a r  
 	 	 t h i s . r e m o v e T o o l b a r E l e m e n t   =   f u n c t i o n ( e l e m e n t )   {  
 	 	 	 i f ( e l e m e n t   = =   " s e p e r a t o r " )   { r e t u r n ; }   / /   d o   n o t   r e m o v e   s e p e r a t o r s  
 	 	 	 f o r ( v a r   i = 0 ; i < t h i s . T o o l b a r . l e n g t h ; i + + )   {  
 	 	 	 	 i f ( t h i s . T o o l b a r [ i ] )   {  
 	 	 	 	 	 v a r   t o o l b a r   =   t h i s . T o o l b a r [ i ] ;  
 	 	 	 	 	 f o r ( v a r   j = 0 ; j < t o o l b a r . l e n g t h ; j + + )   {  
 	 	 	 	 	 	 i f ( t o o l b a r [ j ]   ! =   n u l l   & &   t o o l b a r [ j ]   = =   e l e m e n t )   {  
 	 	 	 	 	 	 	 t h i s . T o o l b a r [ i ] . s p l i c e ( j , 1 ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 } ;  
 	 	  
 	 	 / /   c l e a r   a l l   o r   a   g i v e n   t o o l b a r  
 	 	 t h i s . c l e a r T o o l b a r   =   f u n c t i o n ( t o o l b a r )   {  
 	 	 	 i f ( t y p e o f   t o o l b a r   = =   " u n d e f i n e d " )   {  
 	 	 	 	 t h i s . T o o l b a r   =   n e w   A r r a y ( ) ;  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 t h i s . T o o l b a r [ t o o l b a r + 1 ]   =   n e w   A r r a y ( ) ;  
 	 	 	 }  
 	 	 } ;  
 	 	  
 	 } ,  
 	  
 	 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	 	 ! !   D o   n o t   c h a n g e   s o m e t h i n g   b e l o w   o r   y o u   k n o w   w h a t   y o u   a r e   d o n i n g   ! !  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * / 	  
  
 	 / /   L i s t   o f   a v a i l a b l e   b l o c k   f o r m a t s   ( n o t   i n   u s e )  
 	 / / B l o c k F o r m a t s :   n e w   A r r a y ( " A d d r e s s " ,   " B u l l e t e d   L i s t " ,   " D e f i n i t i o n " ,   " D e f i n i t i o n   T e r m " ,   " D i r e c t o r y   L i s t " ,   " F o r m a t t e d " ,   " H e a d i n g   1 " ,   " H e a d i n g   2 " ,   " H e a d i n g   3 " ,   " H e a d i n g   4 " ,   " H e a d i n g   5 " ,   " H e a d i n g   6 " ,   " M e n u   L i s t " ,   " N o r m a l " ,   " N u m b e r e d   L i s t " ) ,  
  
 	 / /   L i s t   o f   a v a i l a b l e   a c t i o n s   a n d   t h e i r   r e s p e c t i v e   I D   a n d   i m a g e s  
 	 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 ' ,                               	 ' b o l d . g i f ' ,                               ' b o l d _ o n . g i f ' ] ,  
 	 " i t a l i c " :                   [ ' I t a l i c ' ,                               ' Y a t 1k ' ,                           	 ' i t a l i c s . g i f ' ,                         ' 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 g i l i ' ,                     	 ' u n d e r l i n e . g i f ' ,                     ' 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 ' ,                 ' 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 . g i f ' ,             ' 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 " :             [ ' ' ,                                           ' ' ,                                       	 ' s e p e r a t o r . g i f ' ,                     ' 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 ' ,                         ' S u b s c r i p t ' ,                     	 ' s u b s c r i p t . g i f ' ,                     ' 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 ' ,                     ' S u p e r s c r i p t ' ,                 	 ' s u p e r s c r i p t . g i f ' ,                 ' 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 ' ,                     ' J u s t i f y l e f t ' ,                 	 ' j u s t i f y _ l e f t . g i f ' ,               ' 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 ' ,                 ' 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 . g i f ' ,           ' 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 ' ,                   ' J u s t i f y r i g h t ' ,               	 ' j u s t i f y _ r i g h t . g i f ' ,             ' j u s t i f y _ r i g h t _ o n . g i f ' ] ,  
 	 " j u s t i f y f u l l " :   	     [ ' J u s t i f y f u l l ' ,   	 	       ' J u s t i f y f u l l ' ,   	 	 	 ' j u s t i f y _ j u s t i f y . g i f ' ,   	     ' j u s t i f y _ j u s t i f y _ 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 ' ,     ' I n s e r t   U n o r d e r e d   L i s t ' , 	 ' l i s t _ u n o r d e r e d . g i f ' ,           ' 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 ' ,         ' I n s e r t   O r d e r e d   L i s t ' ,     	 ' l i s t _ o r d e r e d . g i f ' ,               ' l i s t _ o r d e r e d _ o n . g i f ' ] ,  
 	 " o u t d e n t " :                 [ ' O u t d e n t ' ,                             ' O u t d e n t ' ,                         	 ' i n d e n t _ l e f t . g i f ' ,                 ' i n d e n t _ l e f t _ o n . g i f ' ] ,  
 	 " i n d e n t " :                   [ ' I n d e n t ' ,                               ' I n d e n t ' ,                           	 ' i n d e n t _ r i g h t . g i f ' ,               ' i n d e n t _ r i g h t _ o n . g i f ' ] ,  
 	 " c u t " :                         [ ' C u t ' ,                                     ' C u t ' ,                                 	 ' c u t . g i f ' ,                                 ' c u t _ o n . g i f ' ] ,  
 	 " c o p y " :                       [ ' C o p y ' ,                                   ' C o p y ' ,                               	 ' c o p y . g i f ' ,                               ' c o p y _ o n . g i f ' ] ,  
 	 " p a s t e " :                     [ ' P a s t e ' ,                                 ' P a s t e ' ,                             	 ' p a s t e . g i f ' ,                             ' p a s t e _ o n . g i f ' ] ,  
 	 " f o r e c o l o r " :             [ ' F o r e C o l o r ' ,                         ' F o r e   C o l o r ' ,                     	 ' f o r e c o l o r . g i f ' ,                     ' f o r e c o l o r _ o n . g i f ' ] ,  
 	 " b a c k c o l o r " :             [ ' B a c k C o l o r ' ,                         ' B a c k   C o l o r ' ,                     	 ' b a c k c o l o r . g i f ' ,                     ' b a c k c o l o r _ o n . g i f ' ] ,  
 	 " u n d o " :                       [ ' U n d o ' ,                                   ' U n d o ' ,                               	 ' u n d o . g i f ' ,                               ' u n d o _ o n . g i f ' ] ,  
 	 " r e d o " :                       [ ' R e d o ' ,                                   ' R e d o ' ,                               	 ' r e d o . g i f ' ,                               ' r e d o _ o n . g i f ' ] ,  
 	 " i n s e r t t a b l e " :         [ ' I n s e r t T a b l e ' ,                     ' I n s e r t   T a b l e ' ,                 	 ' i n s e r t _ t a b l e . g i f ' ,               ' i n s e r t _ t a b l e _ 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 ' ,                     ' I n s e r t   I m a g e ' ,                 	 ' i n s e r t _ p i c t u r e . g i f ' ,           ' 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 ' ,                       ' C r e a t e   L i n k ' ,                   	 ' i n s e r t _ h y p e r l i n k . g i f ' ,       ' 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 ' ,                       ' V i e w   S o u r c e ' ,                   	 ' v i e w _ s o u r c e . g i f ' ,                 ' v i e w _ s o u r c e _ o n . g i f ' ] ,  
 	 " v i e w T e x t " :               [ ' V i e w T e x t ' ,                           ' V i e w   T e x t ' ,                       	 ' v i e w _ t e x t . g i f ' ,                     ' v i e w _ t e x t _ o n . g i f ' ] ,  
 	 " h e l p " :                       [ ' H e l p ' ,                                   ' H e l p ' ,                               	 ' h e l p . g i f ' ,                               ' h e l p _ o n . g i f ' ] ,  
 	 " f o n t s " :           	     [ ' F o n t s ' ,                       	       ' S e l e c t   F o n t ' ,                 	 ' s e l e c t _ f o n t . g i f ' ,                 ' s e l e c t _ f o n t _ o n . g i f ' ] ,  
 	 " f o n t s i z e s " :             [ ' F o n t s i z e s ' ,                         ' S e l e c t   S i z e ' ,                 	 ' s e l e c t _ s i z e . g i f ' ,                 ' s e l e c t _ s i z e _ o n . g i f ' ] ,  
 	 " h e a d i n g s " :               [ ' H e a d i n g s ' ,                           ' S e l e c t   S i z e ' ,                 	 ' s e l e c t _ h e a d i n g . g i f ' ,           ' s e l e c t _ h e a d i n g _ o n . g i f ' ] ,  
 	 " p r e v i e w " : 	 	     [ ' P r e v i e w ' ,   	 	 	       ' P r e v i e w ' ,               	   	 ' p r e v i e w . g i f ' , 	 	 	     ' p r e v i e w _ o n . g i f ' ] ,  
 	 " p r i n t " : 	 	     [ ' P r i n t ' ,   	 	 	       ' P r i n t ' ,               	   	   	 ' p r i n t . g i f ' , 	 	 	     ' p r i n t _ o n . g i f ' ] ,  
 	 " r e m o v e f o r m a t " :       [ ' R e m o v e F o r m a t ' ,                   ' S t r i p   W o r d   H T M L ' ,         	 ' r e m o v e _ f o r m a t . g i f ' ,             ' r e m o v e _ f o r m a t _ o n . g i f ' ] ,  
 	 " d e l e t e " :                   [ ' D e l e t e ' ,                               ' D e l e t e ' ,                           	 ' d e l e t e . g i f ' ,           	 	     ' d e l e t e _ o n . g i f ' ] ,  
 	 " s a v e " :   	 	     [ ' S a v e ' ,   	 	 	 	       ' S a v e   d o c u m e n t ' ,                   ' s a v e . g i f ' ,   	 	 	     ' s a v e _ o n . g i f ' ] ,  
 	 " r e t u r n " :   	 	     [ ' R e t u r n ' ,   	 	 	       ' R e t u r n   w i t h o u t   s a v i n g ' ,   ' r e t u r n . g i f ' ,   	 	 	     ' r e t u r n _ o n . g i f ' ] ,  
 	 " m a x i m i z e " :   	     [ ' M a x i m i z e ' ,   	 	 	       ' M a x i m i z e   t h e   e d i t o r ' ,       ' m a x i m i z e . g i f ' ,   	 	     ' m a x i m i z e _ o n . g i f ' ]  
 	 } ,  
 	  
 	 / /   s t o r e s   t h e   d i f f e r e n t   s e t t i n g s   f o r   e a c h   t e x t a r e a  
 	 / /   t h e   t e x t a r e a   i d e n t i f i e r   i s   u s e d   t o   s t o r e   t h e   s e t t i n g s   o b j e c t  
 	 c o n f i g :   n e w   A r r a y ( ) ,  
 	 / /   C r e a t e   v i e w T e x t M o d e   g l o b a l   v a r i a b l e   a n d   s e t   t o   0  
 	 / /   e n a b l i n g   a l l   t o o l b a r   c o m m a n d s   w h i l e   i n   H T M L   m o d e  
 	 v i e w T e x t M o d e :   n e w   A r r a y ( ) ,  
 	 / /   m a x i m i z e d  
 	 m a x i m i z e d :   n e w   A r r a y ( ) ,  
 	  
 	 / * *  
 	   *   G e t   t h e   r a n g e   o f   t h e   g i v e n   s e l e c t i o n  
 	   *  
 	   *   @ p a r a m   { S e l e c t i o n }   s e l   S e l e c t i o n   o b j e c t  
 	   *   @ r e t u r n   { R a n g e }   R a n g e   o b j e c t  
 	   * /  
 	 g e t R a n g e :   f u n c t i o n ( s e l )   {  
 	 	 r e t u r n   s e l . c r e a t e R a n g e   ?   s e l . c r e a t e R a n g e ( )   :   s e l . g e t R a n g e A t ( 0 ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   R e t u r n   t h e   e d i t o r   d i v   e l e m e n t  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   n   E d i t o r   i d e n t i f i e r    
 	   *   @ r e t u r n   { H t m l D i v E l e m e n t }   I f r a m e   o b j e c t  
 	   * /  
 	 g e t E d i t o r D i v :   f u n c t i o n ( n )   {  
 	 	 r e t u r n   $ ( " w y s i w y g _ d i v _ "   +   n ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   R e t u r n   t h e   e d i t o r   t a b l e   e l e m e n t  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   n   E d i t o r   i d e n t i f i e r    
 	   *   @ r e t u r n   { H t m l T a b l e E l e m e n t }   I f r a m e   o b j e c t  
 	   * /  
 	 g e t E d i t o r T a b l e :   f u n c t i o n ( n )   {  
 	 	 r e t u r n   $ ( " w y s i w y g _ t a b l e _ "   +   n ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   i f r a m e   o b j e c t   o f   t h e   W Y S I W Y G   e d i t o r  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   n   E d i t o r   i d e n t i f i e r    
 	   *   @ r e t u r n   { H t m l I f r a m e E l e m e n t }   I f r a m e   o b j e c t  
 	   * /  
 	 g e t E d i t o r :   f u n c t i o n ( n )   {  
 	 	 r e t u r n   $ ( " w y s i w y g "   +   n ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   e d i t o r s   w i n d o w   e l e m e n t  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   n   E d i t o r   i d e n t i f i e r    
 	   *   @ r e t u r n   { H t m l W i n d o w E l e m e n t }   H t m l   w i n d o w   o b j e c t  
 	   * /  
 	 g e t E d i t o r W i n d o w :   f u n c t i o n ( n )   {  
 	 	 r e t u r n   t h i s . g e t E d i t o r ( n ) . c o n t e n t W i n d o w ;  
 	 } ,  
 	  
 	 / * *  
 	   *   A t t a c h   t h e   W Y S I W Y G   e d i t o r   t o   t h e   g i v e n   t e x t a r e a   e l e m e n t  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   i d   T e x t a r e a   i d e n t i f i e r   ( a l l   =   a l l   t e x t a r e a s )  
 	   *   @ p a r a m   { S e t t i n g s }   s e t t i n g s   t h e   s e t t i n g s   w h i c h   w i l l   b e   a p p l i e d   t o   t h e   t e x t a r e a  
 	   * /  
 	 a t t a c h :   f u n c t i o n ( i d ,   s e t t i n g s )   { 	  
 	 	 i f ( i d   ! =   " a l l " )   { 	  
 	 	 	 t h i s . s e t S e t t i n g s ( i d ,   s e t t i n g s ) ;  
 	 	 	 W Y S I W Y G _ C o r e . i n c l u d e C S S ( t h i s . c o n f i g [ i d ] . C S S F i l e ) ;  
 	 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( w i n d o w ,   " l o a d " ,   f u n c t i o n   g e n e r a t e E d i t o r ( )   { W Y S I W Y G . _ g e n e r a t e ( i d ,   s e t t i n g s ) ; } ) ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( w i n d o w ,   " l o a d " ,   f u n c t i o n   g e n e r a t e E d i t o r ( )   { W Y S I W Y G . a t t a c h A l l ( s e t t i n g s ) ; } ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   A t t a c h   t h e   W Y S I W Y G   e d i t o r   t o   a l l   t e x t a r e a   e l e m e n t s  
 	   *  
 	   *   @ p a r a m   { S e t t i n g s }   s e t t i n g s   S e t t i n g s   t o   c u s t o m i z e   t h e   l o o k   a n d   f e e l  
 	   * /  
 	 a t t a c h A l l :   f u n c t i o n ( s e t t i n g s )   {  
 	 	 v a r   a r e a 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 ( " t e x t a r e a " ) ;  
 	 	 f o r ( v a r   i = 0 ; i < a r e a s . l e n g t h ; i + + )   {  
 	 	 	 v a r   i d   =   a r e a s [ i ] . g e t A t t r i b u t e ( " i d " ) ;  
 	 	 	 i f ( i d   = =   n u l l   | |   i d   = =   " " )   c o n t i n u e ;  
 	 	 	 t h i s . s e t S e t t i n g s ( i d ,   s e t t i n g s ) ;  
 	 	 	 W Y S I W Y G _ C o r e . i n c l u d e C S S ( t h i s . c o n f i g [ i d ] . C S S F i l e ) ;  
 	 	 	 W Y S I W Y G . _ g e n e r a t e ( i d ,   s e t t i n g s ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   D i s p l a y   a n   i f r a m e   i n s t e a d   o f   t h e   t e x t a r e a .    
 	   *   I t ' s   u s e d   a s   t e x t a r e a   r e p l a c e m e n t   t o   d i s p l a y   H T M L .  
 	   *  
 	   *   @ p a r a m   i d   T e x t a r e a   i d e n t i f i e r   ( a l l   =   a l l   t e x t a r e a s )  
 	   *   @ p a r a m   s e t t i n g s   t h e   s e t t i n g s   w h i c h   w i l l   b e   a p p l i e d   t o   t h e   t e x t a r e a  
 	   * /  
 	 d i s p l a y :   f u n c t i o n ( i d ,   s e t t i n g s )   { 	  
 	 	 i f ( i d   ! =   " a l l " )   { 	  
 	 	 	 t h i s . s e t S e t t i n g s ( i d ,   s e t t i n g s ) ;  
 	 	 	 W Y S I W Y G _ C o r e . i n c l u d e C S S ( t h i s . c o n f i g [ i d ] . C S S F i l e ) ;  
 	 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( w i n d o w ,   " l o a d " ,   f u n c t i o n   d i s p l a y I f r a m e ( )   { W Y S I W Y G . _ d i s p l a y ( i d ,   s e t t i n g s ) ; } ) ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( w i n d o w ,   " l o a d " ,   f u n c t i o n   d i s p l a y I f r a m e ( )   { W Y S I W Y G . d i s p l a y A l l ( s e t t i n g s ) ; } ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   D i s p l a y   a n   i f r a m e   i n s t e a d   o f   t h e   t e x t a r e a .    
 	   *   I t ' s   a p p l y   t h e   i f r a m e   t o   a l l   t e x t a r e a s   f o u n d   i n   t h e   c u r r e n t   d o c u m e n t .  
 	   *  
 	   *   @ p a r a m   s e t t i n g s   S e t t i n g s   t o   c u s t o m i z e   t h e   l o o k   a n d   f e e l  
 	   * /  
 	 d i s p l a y A l l :   f u n c t i o n ( s e t t i n g s )   {  
 	 	 v a r   a r e a 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 ( " t e x t a r e a " ) ;  
 	 	 f o r ( v a r   i = 0 ; i < a r e a s . l e n g t h ; i + + )   {  
 	 	 	 v a r   i d   =   a r e a s [ i ] . g e t A t t r i b u t e ( " i d " ) ;  
 	 	 	 i f ( i d   = =   n u l l   | |   i d   = =   " " )   c o n t i n u e ;  
 	 	 	 t h i s . s e t S e t t i n g s ( i d ,   s e t t i n g s ) ;  
 	 	 	 W Y S I W Y G _ C o r e . i n c l u d e C S S ( t h i s . c o n f i g [ i d ] . C S S F i l e ) ;  
 	 	 	 W Y S I W Y G . _ d i s p l a y ( i d ,   s e t t i n g s ) ;  
 	 	 }  
 	 } ,  
 	 	  
 	 / * *  
 	   *   S e t   s e t t i n g s   i n   c o n f i g   a r r a y ,   u s e   t h e   t e x t a r e a   i d   a s   i d e n t i f i e r  
 	   *    
 	   *   @ p a r a m   n   T e x t a r e a   i d e n t i f i e r   ( a l l   =   a l l   t e x t a r e a s )  
 	   *   @ p a r a m   s e t t i n g s   t h e   s e t t i n g s   w h i c h   w i l l   b e   a p p l i e d   t o   t h e   t e x t a r e a  
 	   * /  
 	 s e t S e t t i n g s :   f u n c t i o n ( n ,   s e t t i n g s )   {  
 	 	 i f ( t y p e o f ( s e t t i n g s )   ! =   " o b j e c t " )   {  
 	 	 	 t h i s . c o n f i g [ n ]   =   n e w   t h i s . S e t t i n g s ( ) ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 t h i s . c o n f i g [ n ]   =   s e t t i n g s ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   I n s e r t   o r   m o d i f y   a n   i m a g e  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   s r c   S o u r c e   o f   t h e   i m a g e  
 	   *   @ p a r a m   { I n t e g e r }   w i d t h   W i d t h  
 	   *   @ p a r a m   { I n t e g e r }   h e i g h t   H e i g h t  
 	   *   @ p a r a m   { S t r i n g }   a l i g n   A l i g n m e n t   o f   t h e   i m a g e  
 	   *   @ p a r a m   { S t r i n g }   b o r d e r   B o r d e r   s i z e  
 	   *   @ p a r a m   { S t r i n g }   a l t   A l t e r n a t i v   T e x t  
 	   *   @ p a r a m   { I n t e g e r }   h s p a c e   H o r i z o n t a l   S p a c e  
 	   *   @ p a r a m   { I n t e g e r }   v s p a c e   V e r t i c a l   S p a c e  
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 i n s e r t I m a g e :   f u n c t i o n ( s r c ,   w i d t h ,   h e i g h t ,   a l i g n ,   b o r d e r ,   a l t ,   h s p a c e ,   v s p a c e ,   n )   {  
 	  
 	 	 / /   g e t   e d i t o r  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 / /   g e t   s e l e c t i o n   a n d   r a n g e  
 	 	 v a r   s e l   =   t h i s . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   t h i s . g e t R a n g e ( s e l ) ;  
 	 	  
 	 	 / /   t h e   c u r r e n t   t a g   o f   r a n g e  
 	 	 v a r   i m g   =   t h i s . f i n d P a r e n t ( " i m g " ,   r a n g e ) ;  
 	 	  
 	 	 / /   e l e m e n t   i s   n o t   a   l i n k  
 	 	 v a r   u p d a t e   =   ( i m g   = =   n u l l )   ?   f a l s e   :   t r u e ;  
 	 	 i f ( ! u p d a t e )   {  
 	 	 	 i m g   =   d o c . c r e a t e E l e m e n t ( " i m g " ) ;  
 	 	 }  
 	 	  
 	 	 / /   s e t   t h e   a t t r i b u t e s  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( i m g ,   " s r c " ,   s r c ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( i m g ,   " s t y l e " ,   " w i d t h : "   +   w i d t h   +   " ; h e i g h t : "   +   h e i g h t ) ;  
 	 	 i f ( a l i g n   ! =   " " )   {   W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( i m g ,   " a l i g n " ,   a l i g n ) ;   }   e l s e   {   i m g . r e m o v e A t t r i b u t e ( " a l i g n " ) ;   }  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( i m g ,   " b o r d e r " ,   b o r d e r ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( i m g ,   " a l t " ,   a l t ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( i m g ,   " h s p a c e " ,   h s p a c e ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( i m g ,   " v s p a c e " ,   v s p a c e ) ;  
 	 	 i m g . r e m o v e A t t r i b u t e ( " w i d t h " ) ;  
 	 	 i m g . r e m o v e A t t r i b u t e ( " h e i g h t " ) ;  
 	 	  
 	 	 / /   o n   u p d a t e   e x i t   h e r e  
 	 	 i f ( u p d a t e )   {   r e t u r n ;   }        
 	 	  
 	 	 / /   C h e c k   i f   I E   o r   M o z i l l a   ( o t h e r )  
 	 	 i f   ( W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 r a n g e . p a s t e H T M L ( i m g . o u t e r H T M L ) ;        
 	 	 }  
 	 	 e l s e   {  
 	 	 	 t h i s . i n s e r t N o d e A t S e l e c t i o n ( i m g ,   n ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   I n s e r t   o r   m o d i f y   a   l i n k  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   h r e f   T h e   u r l   o f   t h e   l i n k  
 	   *   @ p a r a m   { S t r i n g }   t a r g e t   T a r g e t   o f   t h e   l i n k  
 	   *   @ p a r a m   { S t r i n g }   s t y l e   S t y l e s h e e t   o f   t h e   l i n k  
 	   *   @ p a r a m   { S t r i n g }   s t y l e C l a s s   S t y l e s h e e t   c l a s s   o f   t h e   l i n k  
 	   *   @ p a r a m   { S t r i n g }   n a m e   N a m e   a t t r i b u t e   o f   t h e   l i n k  
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 i n s e r t L i n k :   f u n c t i o n ( h r e f ,   t a r g e t ,   s t y l e ,   s t y l e C l a s s ,   n a m e ,   n )   {  
 	  
 	 	 / /   g e t   e d i t o r  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 / /   g e t   s e l e c t i o n   a n d   r a n g e  
 	 	 v a r   s e l   =   t h i s . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   t h i s . g e t R a n g e ( s e l ) ;  
 	 	 v a r   l i n   =   n u l l ;  
 	 	  
 	 	 / /   g e t   e l e m e n t   f r o m   s e l e c t i o n  
 	 	 i f ( W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 i f ( s e l . t y p e   = =   " C o n t r o l "   & &   r a n g e . l e n g t h   = =   1 )   { 	  
 	 	 	 	 r a n g e   =   t h i s . g e t T e x t R a n g e ( r a n g e ( 0 ) ) ;  
 	 	 	 	 r a n g e . s e l e c t ( ) ;  
 	 	 	 }  
 	 	 }  
  
 	 	 / /   f i n d   a   a s   p a r e n t   e l e m e n t  
 	 	 l i n   =   t h i s . f i n d P a r e n t ( " a " ,   r a n g e ) ;  
 	 	 	 	  
 	 	 / /   c h e c k   i f   p a r e n t   i s   f o u n d  
 	 	 v a r   u p d a t e   =   ( l i n   = =   n u l l )   ?   f a l s e   :   t r u e ;  
 	 	 i f ( ! u p d a t e )   {  
 	 	 	 l i n   =   d o c . c r e a t e E l e m e n t ( " a " ) ;  
 	 	 }  
 	 	  
 	 	 / /   s e t   t h e   a t t r i b u t e s  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( l i n ,   " h r e f " ,   h r e f ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( l i n ,   " c l a s s " ,   s t y l e C l a s s ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( l i n ,   " c l a s s N a m e " ,   s t y l e C l a s s ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( l i n ,   " t a r g e t " ,   t a r g e t ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( l i n ,   " n a m e " ,   n a m e ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( l i n ,   " s t y l e " ,   s t y l e ) ;  
 	 	  
 	 	 / /   o n   u p d a t e   e x i t   h e r e  
 	 	 i f ( u p d a t e )   {   r e t u r n ;   }  
 	  
 	 	 / /   C h e c k   i f   I E   o r   M o z i l l a   ( o t h e r )  
 	 	 i f   ( W Y S I W Y G _ C o r e . i s M S I E )   { 	  
 	 	 	 r a n g e . s e l e c t ( ) ;  
 	 	 	 l i n . i n n e r H T M L   =   r a n g e . h t m l T e x t ;  
 	 	 	 r a n g e . p a s t e H T M L ( l i n . o u t e r H T M L ) ;        
 	 	 }    
 	 	 e l s e   { 	 	 	  
 	 	 	 v a r   n o d e   =   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 ;  
 	 	 	 i f ( n o d e . n o d e T y p e   ! =   3 )   {   n o d e   =   n o d e . c h i l d N o d e s [ p o s ] ;   }  
 	 	 	 i f ( n o d e . t a g N a m e )  
 	 	 	 	 l i n . a p p e n d C h i l d ( n o d e ) ;  
 	 	 	 e l s e  
 	 	 	 	 l i n . i n n e r H T M L   =   s e l ;  
 	 	 	 t h i s . i n s e r t N o d e A t S e l e c t i o n ( l i n ,   n ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   S t r i p s   a n y   H T M L   a d d e d   b y   w o r d  
 	   *  
           *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 r e m o v e F o r m a t :   f u n c t i o n ( n )   {  
 	 	  
 	 	 i f   (   ! c o n f i r m ( t h i s . c o n f i g [ n ] . R e m o v e F o r m a t C o n f M e s s a g e )   )   {   r e t u r n ;   }  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 v a r   s t r   =   d o c . b o d y . i n n e r H T M L ;  
 	 	  
 	 	 s t r   =   s t r . r e p l a c e ( / < s p a n ( [ ^ > ] ) * > ( & n b s p ; ) * \ s * < \ / s p a n > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < s p a n [ ^ > ] * > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < \ / s p a n [ ^ > ] * > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < p ( [ ^ > ] ) * > ( & n b s p ; ) * \ s * < \ / p > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < p [ ^ > ] * > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < \ / p [ ^ > ] * > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < h ( [ ^ > ] ) [ 0 - 9 ] > ( & n b s p ; ) * \ s * < \ / h > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < h [ ^ > ] [ 0 - 9 ] > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < \ / h [ ^ > ] [ 0 - 9 ] > / g i ,   ' ' ) ;    
 	 	 s t r   =   s t r . r e p l a c e   ( / < B   [ ^ > ] * > / i g ,   ' < b > ' ) ;  
 	 	  
 	 	 / /   v a r   r e p l _ i 1   =   / < I [ ^ > ] * > / i g ;  
 	 	 / /   s t r   =   s t r . r e p l a c e   ( r e p l _ i 1 ,   ' < i > ' ) ;  
 	 	  
 	 	 s t r   =   s t r . r e p l a c e   ( / < D I V [ ^ > ] * > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < \ / D I V > / g i ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < [ \ / \ w ? ] + : [ ^ > ] * > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / ( & n b s p ; ) { 2 , } / i g ,   ' & n b s p ; ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < S T R O N G > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < \ / S T R O N G > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < T T > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < \ / T T > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < F O N T   [ ^ > ] * > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / < \ / F O N T > / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e   ( / S T Y L E = \ " [ ^ \ " ] * \ " / i g ,   ' ' ) ;  
 	 	 s t r   =   s t r . r e p l a c e ( / < ( [ \ w ] + )   c l a s s = ( [ ^   | > ] * ) ( [ ^ > ] * ) / g i ,   ' < $ 1 $ 3 ' ) ;  
     	         s t r   =   s t r . r e p l a c e ( / < ( [ \ w ] + )   s t y l e = " ( [ ^ " ] * ) " ( [ ^ > ] * ) / g i ,   ' < $ 1 $ 3 ' ) ;    
 	 	 s t r   =   s t r . r e p l a c e ( / w i d t h = ( [ ^   | > ] * ) ( [ ^ > ] * ) / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / c l a s s n a m e = ( [ ^   | > ] * ) ( [ ^ > ] * ) / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / a l i g n = ( [ ^   | > ] * ) ( [ ^ > ] * ) / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / v a l i g n = ( [ ^   | > ] * ) ( [ ^ > ] * ) / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < \ \ ? \ ? ? x m l [ ^ > ] > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < \ / ? \ w + : [ ^ > ] * > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / < s t 1 : . * ? > / g i ,   ' ' ) ;  
 	         s t r   =   s t r . r e p l a c e ( / o : / g i ,   ' ' ) ;    
 	          
 	         s t r   =   s t r . r e p l a c e ( / < ! - - ( [ ^ > ] ) * > ( & n b s p ; ) * \ s * < \ / - - > / g i ,   ' ' ) ;  
       	 	 s t r   =   s t r . r e p l a c e ( / < ! - - [ ^ > ] * > / g i ,   ' ' ) ;  
       	 	 s t r   =   s t r . r e p l a c e ( / < \ / - - [ ^ > ] * > / g i ,   ' ' ) ;  
 	 	  
 	 	 d o c . b o d y . i n n e r H T M L   =   s t r ;  
 	 } ,  
 	  
 	 / * *  
 	   *   D i s p l a y   a n   i f r a m e   i n s t e a d   o f   t h e   t e x t a r e a .  
 	   *    
 	   *   @ p r i v a t e  
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   *   @ p a r a m   { O b j e c t }   s e t t i n g s   O b j e c t   w h i c h   h o l d s   t h e   s e t t i n g s  
 	   * /  
 	 _ d i s p l a y :   f u n c t i o n ( n ,   s e t t i n g s )   {  
 	 	 	  
 	 	 / /   G e t   t h e   t e x t a r e a   e l e m e n t  
 	 	 v a r   t e x t a r e a   =   $ ( n ) ;  
 	 	  
 	 	 / /   V a l i d a t e   i f   t e x t a r e a   e x i s t s  
 	 	 i f ( t e x t a r e a   = =   n u l l )   {  
 	 	 	 a l e r t ( " N o   t e x t a r e a   f o u n d   w i t h   t h e   g i v e n   i d e n t i f i e r   ( I D :   "   +   n   +   " ) . " ) ;  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 	  
 	 	 / /   V a l i d a t e   b r o w s e r   c o m p a t i b l i t y  
 	 	 i f ( ! W Y S I W Y G _ C o r e . i s B r o w s e r C o m p a t i b l e ( ) )   {  
 	 	 	 i f ( t h i s . c o n f i g [ n ] . N o V a l i d B r o w s e r M e s s a g e   ! =   " " )   {   a l e r t ( t h i s . c o n f i g [ n ] . N o V a l i d B r o w s e r M e s s a g e ) ;   }  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 	  
 	         / /   L o a d   s e t t i n g s   i n   c o n f i g   a r r a y ,   u s e   t h e   t e x t a r e a   i d   a s   i d e n t i f i e r  
 	 	 i f ( t y p e o f ( s e t t i n g s )   ! =   " o b j e c t " )   {  
 	 	 	 t h i s . c o n f i g [ n ]   =   n e w   t h i s . S e t t i n g s ( ) ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 t h i s . c o n f i g [ n ]   =   s e t t i n g s ;  
 	 	 }  
 	 	  
 	 	 / /   H i d e   t h e   t e x t a r e a    
 	 	 t e x t a r e a . s t y l e . d i s p l a y   =   " n o n e " ;  
 	 	  
 	 	 / /   O v e r r i d e   t h e   w i d t h   a n d   h e i g h t   o f   t h e   e d i t o r   w i t h   t h e    
 	 	 / /   s i z e   g i v e n   b y   t h e   s t y l e   a t t r i b u t e s   w i d t h   a n d   h e i g h t  
 	 	 i f ( t e x t a r e a . s t y l e . w i d t h )   {  
 	 	 	 t h i s . c o n f i g [ n ] . W i d t h   =   t e x t a r e a . s t y l e . w i d t h ;  
 	 	 }  
 	 	 i f ( t e x t a r e a . s t y l e . h e i g h t )   {  
 	 	 	 t h i s . c o n f i g [ n ] . H e i g h t   =   t e x t a r e a . s t y l e . h e i g h t  
 	 	 }    
 	 	 	  
 	         / /   d e t e r m i n e   t h e   w i d t h   +   h e i g h t  
 	 	 v a r   c u r r e n t W i d t h   =   t h i s . c o n f i g [ n ] . W i d t h ;  
 	 	 v a r   c u r r e n t H e i g h t   =   t h i s . c o n f i g [ n ] . H e i g h t ;  
 	    
 	 	 / /   C a l c u l a t e   t h e   w i d t h   +   h e i g h t   o f   t h e   e d i t o r    
 	 	 v a r   i f r m W i d t h   =   " 1 0 0 % " ;  
 	 	 v a r 	 i f r m H e i g h t   =   " 1 0 0 % " ;  
 	 	 i f ( c u r r e n t W i d t h . s e a r c h ( / % / )   = =   - 1 )   {  
 	 	 	 i f r m W i d t h   =   c u r r e n t W i d t h ;  
 	 	 	 i f r m H e i g h t   =   c u r r e n t H e i g h t ;  
 	 	 }  
 	 	 	 	  
 	 	 / /   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 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 "   s t y l e = " w i d t h : '   +   c u r r e n t W i d t h   +   ' ;   h e i g h t : '   +   c u r r e n t H e i g h t   +   ' ; "   c l a s s = " t a b l e T e x t a r e a E d i t o r " > < 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   +   ' "   c l a s s = " i f r a m e T e x t "   s t y l e = " w i d t h : '   +   i f r m W i d t h   +   ' ; h e i g h t : '   +   i f r m H e i g h t   +   ' ; " > < / 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  
 	 	 t e x t a r e a . 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 " ,   i f r a m e ) ;  
 	 	 	 	 	 	  
 	 	 / /   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   =   t e x t a r e a . v a l u e ;  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	  
 	 	 / /   R e p l a c e   a l l   \ n   w i t h   < b r >    
 	 	 i f ( t h i s . c o n f i g [ n ] . R e p l a c e L i n e B r e a k s )   {  
 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( / ( \ r \ n ) | ( \ n ) / i g ,   " < b r > " ) ;  
 	 	 }  
 	 	 	  
 	 	 / /   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 ( ) ;  
 	          
 	         / /   S e t   d e f a u l t   s t y l e   o f   t h e   e d i t o r   w i n d o w  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( d o c . b o d y ,   " s t y l e " ,   t h i s . c o n f i g [ n ] . D e f a u l t S t y l e ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   R e p l a c e   t h e   g i v e n   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  
 	   *    
 	   *   @ p r i v a t e  
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   *   @ p a r a m   { O b j e c t }   s e t t i n g s   O b j e c t   w h i c h   h o l d s   t h e   s e t t i n g s  
 	   * /  
 	 _ g e n e r a t e :   f u n c t i o n ( n ,   s e t t i n g s )   {  
 	 	 	 	          
 	 	 / /   G e t   t h e   t e x t a r e a   e l e m e n t  
 	 	 v a r   t e x t a r e a   =   $ ( n ) ;  
 	 	 / /   V a l i d a t e   i f   t e x t a r e a   e x i s t s  
 	 	 i f ( t e x t a r e a   = =   n u l l )   {  
 	 	 	 a l e r t ( " N o   t e x t a r e a   f o u n d   w i t h   t h e   g i v e n   i d e n t i f i e r   ( I D :   "   +   n   +   " ) . " ) ;  
 	 	 	 r e t u r n ;  
 	 	 } 	          
 	 	  
 	 	 / /   V a l i d a t e   b r o w s e r   c o m p a t i b l i t y  
 	 	 i f ( ! W Y S I W Y G _ C o r e . i s B r o w s e r C o m p a t i b l e ( ) )   {  
 	 	 	 i f ( t h i s . c o n f i g [ n ] . N o V a l i d B r o w s e r M e s s a g e   ! =   " " )   {   a l e r t ( t h i s . c o n f i g [ n ] . N o V a l i d B r o w s e r M e s s a g e ) ;   }  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 	 	 	 	 	 	 	  
 	 	 / /   H i d e   t h e   t e x t a r e a    
 	 	 t e x t a r e a . s t y l e . d i s p l a y   =   ' n o n e ' ;    
 	 	  
 	 	 / /   O v e r r i d e   t h e   w i d t h   a n d   h e i g h t   o f   t h e   e d i t o r   w i t h   t h e    
 	 	 / /   s i z e   g i v e n   b y   t h e   s t y l e   a t t r i b u t e s   w i d t h   a n d   h e i g h t  
 	 	 i f ( t e x t a r e a . s t y l e . w i d t h )   {  
 	 	 	 t h i s . c o n f i g [ n ] . W i d t h   =   t e x t a r e a . s t y l e . w i d t h ;  
 	 	 }  
 	 	 i f ( t e x t a r e a . s t y l e . h e i g h t )   {  
 	 	 	 t h i s . c o n f i g [ n ] . H e i g h t   =   t e x t a r e a . s t y l e . h e i g h t  
 	 	 }  
 	 	 	  
 	         / /   d e t e r m i n e   t h e   w i d t h   +   h e i g h t  
 	 	 v a r   c u r r e n t W i d t h   =   t h i s . c o n f i g [ n ] . W i d t h ;  
 	 	 v a r   c u r r e n t H e i g h t   =   t h i s . c o n f i g [ n ] . H e i g h t ;  
 	    
 	 	 / /   C a l c u l a t e   t h e   w i d t h   +   h e i g h t   o f   t h e   e d i t o r    
 	 	 v a r   t o o l b a r W i d t h   =   c u r r e n t W i d t h ;  
 	 	 v a r   i f r m W i d t h   =   " 1 0 0 % " ;  
 	 	 v a r 	 i f r m H e i g h t   =   " 1 0 0 % " ;  
 	 	 i f ( c u r r e n t W i d t h . s e a r c h ( / % / )   = =   - 1 )   {  
 	 	 	 t o o l b a r W i d t h   =   c u r r e n t W i d t h . r e p l a c e ( / p x / g i ,   " " ) ;  
 	 	 	 t o o l b a r W i d t h   =   ( p a r s e F l o a t ( t o o l b a r W i d t h )   +   2 )   +   " p x " ;  
 	 	 	 i f r m W i d t h   =   c u r r e n t W i d t h ;  
 	 	 	 i f r m H e i g h t   =   c u r r e n t H e i g h t ;  
 	 	 }  
 	 	  
 	         / /   G e n e r a t e   t h e   W Y S I W Y G   T a b l e  
 	         / /   T h i s   t a b l e   h o l d s   t h e   t o o l b a r s   a n d   t h e   i f r a m e   a s   t h e   e d i t o r  
 	         v a r   e d i t o r   =   " " ;  
 	         e d i t o r   + =   ' < d i v   i d = " w y s i w y g _ d i v _ '   +   n   +   ' "   s t y l e = " w i d t h : '   +   c u r r e n t W i d t h     + ' ; " > ' ;  
 	         e d i t o r   + =   ' < 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 "   c l a s s = " t a b l e T e x t a r e a E d i t o r "   i d = " w y s i w y g _ t a b l e _ '   +   n   +   ' "   s t y l e = " w i d t h : '   +   c u r r e n t W i d t h     +   ' ;   h e i g h t : '   +   c u r r e n t H e i g h t   +   ' ; " > ' ;  
 	         e d i t o r   + =   ' < t r > < t d   s t y l e = " h e i g h t : 2 2 p x ; v e r t i c a l - a l i g n : t o p ; " > ' ;  
 	         	      
 	 	 / /   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   j   =   0 ;   j   <   t h i s . c o n f i g [ n ] . T o o l b a r . l e n g t h ; j + + )   {    
 	 	 	 i f ( t h i s . c o n f i g [ n ] . T o o l b a r [ j ]   & &   t h i s . c o n f i g [ n ] . T o o l b a r [ j ] . l e n g t h   >   0 )   {  
 	 	 	 	 v a r   t o o l b a r   =   t h i s . c o n f i g [ n ] . T o o l b a r [ j ] ;  
 	 	 	 	  
 	 	 	 	 / /   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  
 	 	 	         e d i t o r   + =   ' < 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 "   c l a s s = " t o o l b a r 1 "   s t y l e = " w i d t h : 1 0 0 % ; "   i d = " t o o l b a r '   +   j   +   ' _ '   +   n   +   ' " > ' ;  
 	         	 	 e d i t o r   + =   ' < t r > < t d   s t y l e = " w i d t h : 6 p x ; " > < i m g   s r c = " '   +   t h i s . c o n f i g [ n ] . 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 > ' ;  
 	 	 	 	  
 	 	 	 	 / /   I n t e r a t e   o v e r   t h e   t o o l b a r   e l e m e n t  
 	 	 	 	 f o r   ( v a r   i   =   0 ;   i   <   t o o l b a r . l e n g t h ; i + + )   {    
 	 	 	 	 	 v a r   i d   =   t o o l b a r [ i ] ;  
 	 	 	 	         i f   ( t o o l b a r [ i ] )   {  
 	 	 	 	         	 i f ( t y p e o f   ( t h i s . c o n f i g [ n ] . D r o p D o w n s [ i d ] )   ! =   " u n d e f i n e d " )   {  
 	 	 	 	         	 	 v a r   d r o p d o w n   =   t h i s . c o n f i g [ n ] . D r o p D o w n s [ i d ] ;  
 	 	 	 	         	 	 e d i t o r   + =   ' < t d   s t y l e = " w i d t h :   '   +   d r o p d o w n . w i d t h   +   ' ; " > ' ;  
 	 	 	 	         	 	 / /   w r i t e   t h e   d r o p   d o w n   c o n t e n t  
 	 	 	 	         	 	 e d i t o r   + =   t h i s . w r i t e D r o p D o w n ( n ,   i d ) ;  
 	 	 	 	         	 	 e d i t o r   + =   ' < / t d > ' ;  
 	 	 	 	         	 }  
 	 	 	 	         	 e l s e   {  
 	 	 	 	         	 	 	  
 	 	 	 	         	 	 / /   G e t   t h e   v a l u e s   o f   t h e   B u t t o n   f r o m   t h e   g l o b a l   T o o l b a r L i s t   o b j e c t  
 	 	 	 	 	 	 	 v a r   b u t t o n O b j   =   t h i s . T o o l b a r L i s t [ t o o l b a r [ i ] ] ;  
 	 	 	 	 	 	 	 i f ( b u t t o n O b 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   =   t h i s . c o n f i g [ n ] . I m a g e s D i r   +   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     =   t h i s . c o n f i g [ n ] . I m a g e s D i r   +   b u t t o n O b j [ 3 ] ;  
 	 	 	 	 	 	 	 	          
 	 	 	 	 	 	 	 	 i f   ( t o o l b a r [ i ]   = =   " s e p e r a t o r " )   {  
 	 	 	 	 	 	 	 	 	 e d i t o 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 " > ' ;  
 	 	 	 	 	 	 	 	 	 e d i t o 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 " > ' ;  
 	 	 	 	 	 	 	 	 	 e d i t o r   + =   ' < / t d > ' ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 / /   V i e w   S o u r c e   b u t t o n  
 	 	 	 	 	 	 	 	 e l s e   i f   ( t o o l b a r [ i ]   = =   " v i e w S o u r c e " ) {  
 	 	 	 	 	 	 	 	         e d i t o r   + =   ' < t d   s t y l e = " w i d t h :   2 2 p x ; " > ' ;  
 	 	 	 	 	 	 	 	 	 e d i t o r   + =   ' < 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 E d i t o r "   o n m o u s e o v e r = " t h i s . c l a s s N a m e = \ ' b u t t o n E d i t o r 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 = " t h i s . c l a s s N a m e = \ ' b u t t o n E d i t o r \ ' ;   t h i s . s r c = \ ' '   +   b u t t o n I m a g e   +   ' \ ' ; "   o n c l i c k = " W Y S I W Y G . e x e c C o m m a n d ( \ ' '   +   n   +   ' \ ' ,   \ ' '   +   b u t t o n I D   +   ' \ ' ) ; "   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 > ' ;  
 	 	 	 	 	 	 	 	 	 e d i t o r   + =   ' < s p a n   i d = " t e x t M o d e '   +   n   +   ' " > < i m g   s r c = " '   +   t h i s . c o n f i g [ n ] . 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 E d i t o r "   o n m o u s e o v e r = " t h i s . c l a s s N a m e = \ ' b u t t o n E d i t o r O v e r \ ' ;   t h i s . s r c = \ ' '   +   t h i s . c o n f i g [ n ] . 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 = " t h i s . c l a s s N a m e = \ ' b u t t o n E d i t o r \ ' ;   t h i s . s r c = \ ' '   +   t h i s . c o n f i g [ n ] . I m a g e s D i r   +   ' v i e w _ t e x t . g i f \ ' ; "   o n c l i c k = " W Y S I W Y G . e x e c C o m m a n d ( \ ' '   +   n   +   ' \ ' , \ ' V i e w T e x t \ ' ) ; "   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 > ' ;  
 	 	 	 	 	 	 	                 e d i t o r   + =   ' < / t d > ' ;  
 	 	 	 	 	 	                 }  
 	 	 	 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 	 	 	 e d i t o r   + =   ' < t d   s t y l e = " w i d t h :   2 2 p x ; " > ' ;  
 	 	 	 	 	 	 	 	 	 e d i t o 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 "   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 E d i t o r "   o n m o u s e o v e r = " t h i s . c l a s s N a m e = \ ' b u t t o n E d i t o r 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 = " t h i s . c l a s s N a m e = \ ' b u t t o n E d i t o r \ ' ;   t h i s . s r c = \ ' '   +   b u t t o n I m a g e   +   ' \ ' ; "   o n c l i c k = " W Y S I W Y G . e x e c C o m m a n d ( \ ' '   +   n   +   ' \ ' ,   \ ' '   +   b u t t o n I D   +   ' \ ' ) ; "   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 " > ' ;  
 	 	 	 	 	 	 	 	 	 e d i t o r   + =   ' < / t d > ' ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	     	 	 }  
 	 	 	     	 }  
 	 	 	     	 e d i t o r   + =   ' < t d > & n b s p ; < / t d > < / t r > < / t a b l e > ' ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	   	 e d i t o r   + =   ' < / t d > < / t r > < t r > < t d   v a l i g n = " t o p " > \ n ' ;  
 	 	 / /   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  
 	 	 e d i t o r   + =   ' < 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   +   ' "   c l a s s = " i f r a m e T e x t "   s t y l e = " w i d t h : 1 0 0 % ; h e i g h t : '   +   c u r r e n t H e i g h t   +   ' ; " > < / i f r a m e > \ n '  
 	         +   ' < / t d > < / t r > ' ;  
 	         / /   S t a t u s   b a r   H T M L   c o d e  
 	         i f ( t h i s . c o n f i g [ n ] . S t a t u s B a r E n a b l e d )   {  
 	 	         e d i t o r   + =   ' < t r > < t d   c l a s s = " w y s i w y g - s t a t u s b a r "   s t y l e = " h e i g h t : 1 0 p x ; "   i d = " w y s i w y g _ s t a t u s b a r _ '   +   n   +   ' " > & n b s p ; < / t d > < / t r > ' ;          
 	 	 }  
 	         e d i t o r   + =   ' < / t a b l e > ' ;  
 	         e d i t o r   + =   ' < / d i v > ' ;  
 	          
 	         / /   I n s e r t   t h e   e d i t o r   a f t e r   t h e   t e x t a r e a 	          
 	         t e x t a r e a . 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 " ,   e d i t o r ) ;  
 	         	 	 	 	 	  
 	 	 / /   H i d e   t h e   " T e x t   M o d e "   b u t t o n  
 	 	 / /   V a l i d a t e   i f   t e x t M o d e   E l e m e n t s   a r e   p r e n s e n t  
 	 	 i f ( $ ( " t e x t M o d e "   +   n ) )   {  
 	 	 	 $ ( " 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 ' ;    
 	 	 }  
 	 	 	 	 	 	  
 	 	 / /   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   =   t e x t a r e a . v a l u e ;  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ; 	 	  
 	 	  
  
 	 	 / /   R e p l a c e   a l l   \ n   w i t h   < b r >    
 	 	 i f ( t h i s . c o n f i g [ n ] . R e p l a c e L i n e B r e a k s )   {  
 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( / \ n \ r | \ n / i g ,   " < b r > " ) ;  
 	 	 }  
 	 	 	 	  
 	 	 / /   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  
 	 	 / /   I m p r o v e   c o m p a t i b l i t y   f o r   I E   +   M o z i l l a  
 	 	 i f   ( d o c . b o d y . c o n t e n t E d i t a b l 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 ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 d o c . d e s i g n M o d e   =   " o n " ; 	  
 	 	 }  
 	  
 	 	 / /   S e t   d e f a u l t   f o n t   s t y l e  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( d o c . b o d y ,   " s t y l e " ,   t h i s . c o n f i g [ n ] . D e f a u l t S t y l e ) ;  
 	 	  
 	 	 / /   E n a b l e   t a b l e   h i g h l i g h t i n g  
 	 	 W Y S I W Y G _ T a b l e . r e f r e s h H i g h l i g h t i n g ( n ) ;  
 	          
 	         / /   E v e n t   H a n d l i n g  
 	         / /   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  
 	         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 + + )   {  
 	         	 W Y S I W Y G _ C o r e . a d d E v e n t ( d o c u m e n t . f o r m s [ i d x ] ,   " s u b m i t " ,   f u n c t i o n   x x x _ a a ( )   {   W Y S I W Y G . u p d a t e T e x t A r e a ( n ) ;   } ) ;  
 	         }  
 	          
 	         / /   c l o s e   f o n t   s e l e c t i o n   i f   m o u s e   m o v e s   o v e r   t h e   e d i t o r   w i n d o w  
 	         W Y S I W Y G _ C o r e . a d d E v e n t ( d o c ,   " m o u s e o v e r " ,   f u n c t i o n   x x x _ b b ( )   {   W Y S I W Y G . c l o s e D r o p D o w n s ( n ) ; } ) ;  
 	          
 	         / /   I f   i t ' s   t r u e   i n v e r t   t h e   l i n e   b r e a k   c a p a b i l i t y   o f   I E  
 	 	 i f ( t h i s . c o n f i g [ n ] . I n v e r t I E L i n e B r e a k s )   {  
 	 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( d o c ,   " k e y p r e s s " ,   f u n c t i o n   x x x _ c c ( )   {   W Y S I W Y G . i n v e r t I E L i n e B r e a k C a p a b i l i t y ( n ) ;   } ) ;  
 	 	 }  
 	 	 	 	 	  
 	 	 / /   s t a t u s   b a r   u p d a t e  
 	 	 i f ( t h i s . c o n f i g [ n ] . S t a t u s B a r E n a b l e d )   {  
 	 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( d o c ,   " m o u s e u p " ,   f u n c t i o n   x x x _ d d ( )   {   W Y S I W Y G . u p d a t e S t a t u s B a r ( n ) ;   } ) ;  
 	 	 }  
 	         	          
         	 / /   c u s t o m   c o n t e x t   m e n u  
 	 	 i f ( t h i s . c o n f i g [ n ] . C o n t e x t M e n u )   { 	  
 	 	 	 W Y S I W Y G _ C o n t e x t M e n u . i n i t ( n ) ; 	 	  
 	 	 }  
 	 	 	 	 	 	 	 	  
 	 	 / /   i n i t   v i e w T e x t M o d e   v a r  
 	         t h i s . v i e w T e x t M o d e [ n ]   =   f a l s e ; 	 	 	  
 	 } ,  
 	  
 	 / * *  
 	   *   D i s a b l e   t h e   g i v e n   W Y S I W Y G   E d i t o r   B o x  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /    
 	 d i s a b l e :   f u n c t i o n ( n )   {  
 	 	  
 	 	 / /   g e t   t h e   e d i t o r   w i n d o w  
 	 	 v a r   e d i t o r   =   t h i s . g e t E d i t o r W i n d o w ( n ) ;  
 	  
 	 	 / /   V a l i d a t e   i f   e d i t o r   e x i s t s  
 	 	 i f ( e d i t o r   = =   n u l l )   {  
 	 	 	 a l e r t ( " N o   e d i t o r   f o u n d   w i t h   t h e   g i v e n   i d e n t i f i e r   ( I D :   "   +   n   +   " ) . " ) ;  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 	  
 	 	 i f ( e d i t o r )   {  
 	 	 	 / /   d i s a b l e   d e s i g n   m o d e   o r   c o n t e n t   e d i t a b l e   f e a t u r e  
 	 	 	 i f ( e d i t o r . d o c u m e n t . b o d y . c o n t e n t E d i t a b l e )   {  
 	 	 	 	 e d i t o r . d o c u m e n t . b o d y . c o n t e n t E d i t a b l e   =   f a l s e ;  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 e d i t o r . d o c u m e n t . d e s i g n M o d e   =   " O f f " ; 	 	  
 	 	 	 }  
 	 	 	 	  
 	 	 	 / /   c h a n g e   t h e   s t y l e   o f   t h e   b o d y  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( e d i t o r . d o c u m e n t . b o d y ,   " s t y l e " ,   t h i s . c o n f i g [ n ] . D i s a b l e d S t y l e ) ;  
 	 	 	  
 	 	 	 / /   h i d e   t h e   s t a t u s   b a r  
 	 	 	 t h i s . h i d e S t a t u s B a r ( n ) ;  
 	 	 	 	 	 	 	  
 	 	 	 / /   h i d e   a l l   t o o l b a r s  
 	 	 	 t h i s . h i d e T o o l b a r s ( n ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   E n a b l e s   t h e   g i v e n   W Y S I W Y G   E d i t o r   B o x  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 e n a b l e :   f u n c t i o n ( n )   {  
 	 	 	  
 	 	 / /   g e t   t h e   e d i t o r   w i n d o w  
 	 	 v a r   e d i t o r   =   t h i s . g e t E d i t o r W i n d o w ( n ) ;  
 	  
 	 	 / /   V a l i d a t e   i f   e d i t o r   e x i s t s  
 	 	 i f ( e d i t o r   = =   n u l l )   {  
 	 	 	 a l e r t ( " N o   e d i t o r   f o u n d   w i t h   t h e   g i v e n   i d e n t i f i e r   ( I D :   "   +   n   +   " ) . " ) ;  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 	  
 	 	 i f ( e d i t o r )   {  
 	 	 	 / /   d i s a b l e   d e s i g n   m o d e   o r   c o n t e n t   e d i t a b l e   f e a t u r e  
 	 	 	 i f ( e d i t o r . d o c u m e n t . b o d y . c o n t e n t E d i t a b l e ) {  
 	 	 	 	 e d i t o r . d o c u m e n t . b o d y . c o n t e n t E d i t a b l e   =   t r u e ;  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 e d i t o r . d o c u m e n t . d e s i g n M o d e   =   " O n " ; 	 	  
 	 	 	 }  
 	 	 	 	  
 	 	 	 / /   c h a n g e   t h e   s t y l e   o f   t h e   b o d y  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( e d i t o r . d o c u m e n t . b o d y ,   " s t y l e " ,   t h i s . c o n f i g [ n ] . D e f a u l t S t y l e ) ;  
 	 	 	  
 	 	 	 / /   h i d e   t h e   s t a t u s   b a r  
 	 	 	 t h i s . s h o w S t a t u s B a r ( n ) ;  
 	 	 	 	 	 	 	  
 	 	 	 / /   h i d e   a l l   t o o l b a r s  
 	 	 	 t h i s . s h o w T o o l b a r s ( n ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   R e t u r n s   t h e   n o d e   s t r u c t u r e   o f   t h e   c u r r e n t   s e l e c t i o n   a s   a r r a y  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 g e t N o d e T r e e :   f u n c t i o n ( n )   {  
 	 	  
 	 	 v a r   s e l   =   t h i s . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   t h i s . g e t R a n g e ( s e l ) ; 	  
 	 	 	  
 	 	 / /   g e t   e l e m e n t   o f   r a n g e  
 	 	 v a r   t a g   =   t h i s . g e t T a g ( r a n g e ) ;  
 	 	 i f ( t a g   = =   n u l l )   {   r e t u r n ;   }  
 	 	 / /   g e t   p a r e n t   o f   e l e m e n t  
 	 	 v a r   n o d e   =   t h i s . g e t P a r e n t ( t a g ) ;  
 	 	 / /   i n i t   t h e   t r e e   a s   a r r a y   w i t h   t h e   c u r r e n t   s e l e c t e d   e l e m e n t  
 	 	 v a r   n o d e T r e e   =   n e w   A r r a y ( t a g ) ;  
 	 	 / /   g e t   a l l   p a r e n t   n o d e s  
 	 	 v a r   i i   =   1 ;  
 	 	  
 	 	 w h i l e ( n o d e   ! =   n u l l   & &   n o d e . n o d e N a m e   ! =   " # d o c u m e n t " )   {  
 	 	 	 n o d e T r e e [ i i ]   =   n o d e ;  
 	 	 	 n o d e   =   t h i s . g e t P a r e n t ( n o d e ) ; 	 	 	  
 	 	 	 i i + + ;  
 	 	 }  
 	 	  
 	 	 r e t u r n   n o d e T r e e ;  
 	 } ,  
 	  
 	 / * *  
 	   *   R e m o v e s   t h e   c u r r e n t   n o d e   o f   t h e   s e l e c t i o n  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 r e m o v e N o d e :   f u n c t i o n ( n )   {  
 	 	 / /   g e t   s e l e c t i o n   a n d   r a n g e  
 	 	 v a r   s e l   =   t h i s . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   t h i s . g e t R a n g e ( s e l ) ;  
 	 	 / /   t h e   c u r r e n t   t a g   o f   r a n g e  
 	 	 v a r   t a g   =   t h i s . g e t T a g ( r a n g e ) ;  
 	 	 v a r   p a r e n t   =   t a g . p a r e n t N o d e ;  
 	 	 i f ( t a g   = =   n u l l   | |   p a r e n t   = =   n u l l )   {   r e t u r n ;   }  
 	 	 i f ( t a g . n o d e N a m e   = =   " H T M L "   | |   t a g . n o d e N a m e   = =   " B O D Y " )   {   r e t u r n ;   }  
  
 	 	 / /   c o p y   c h i l d   e l e m e n t s   o f   t h e   n o d e   t o   t h e   p a r e n t   e l e m e n t   b e f o r e   r e m o v e   t h e   n o d e  
 	 	 v a r   c h i l d N o d e s   =   n e w   A r r a y ( ) ;  
 	 	 f o r ( v a r   i = 0 ;   i   <   t a g . c h i l d N o d e s . l e n g t h ; i + + )  
 	 	 	 c h i l d N o d e s [ i ]   =   t a g . c h i l d N o d e s [ i ] ; 	  
 	 	 f o r ( v a r   i = 0 ;   i   <   c h i l d N o d e s . l e n g t h ; i + + )  
 	 	 	 p a r e n t . i n s e r t B e f o r e ( c h i l d N o d e s [ i ] ,   t a g ) ; 	  
 	 	  
 	 	 / /   r e m o v e   n o d e  
 	 	 p a r e n t . r e m o v e C h i l d ( t a g ) ;  
 	 	 / /   v a l i d a t e   i f   p a r e n t   i s   a   l i n k   a n d   t h e   n o d e   i s   o n l y    
 	 	 / /   s u r r o u n d e d   b y   t h e   l i n k ,   t h e n   r e m o v e   t h e   l i n k   t o o  
 	 	 i f ( p a r e n t . n o d e N a m e   = =   " A "   & &   ! p a r e n t . h a s C h i l d N o d e s ( ) )   {  
 	 	 	 i f ( p a r e n t . p a r e n t N o d e )   {   p a r e n t . p a r e n t N o d e . r e m o v e C h i l d ( p a r e n t ) ;   }  
 	 	 }  
 	 	 / /   u p d a t e   t h e   s t a t u s   b a r  
 	 	 t h i s . u p d a t e S t a t u s B a r ( n ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   s e l e c t i o n   o f   t h e   g i v e n   e d i t o r  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 g e t S e l e c t i o n :   f u n c t i o n ( n )   {  
 	 	 v a r   i f r m   =   t h i s . g e t E d i t o r W i n d o w ( n ) ;  
 	 	 v a r   d o c   =   i f r m . d o c u m e n t ;  
 	 	 v a r   s e l   =   n u l l ;  
 	 	 i f ( i f r m . g e t S e l e c t i o n ) {  
 	 	 	 s e l   =   i f r m . g e t S e l e c t i o n ( ) ;  
 	 	 }  
 	 	 e l s e   i f   ( d o c . g e t S e l e c t i o n )   {  
 	 	 	 s e l   =   d o c . g e t S e l e c t i o n ( ) ;  
 	 	 }  
 	 	 e l s e   i f   ( d o c . s e l e c t i o n )   {  
 	 	 	 s e l   =   d o c . s e l e c t i o n ;  
 	 	 }  
 	 	 r e t u r n   s e l ;  
 	 } ,  
 	  
 	 / * *  
 	   *   U p d a t e s   t h e   s t a t u s   b a r   w i t h   t h e   c u r r e n t   n o d e   t r e e  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 u p d a t e S t a t u s B a r :   f u n c t i o n ( n )   {  
 	 	  
 	 	 / /   g e t   t h e   n o d e   s t r u c t u r e  
 	 	 v a r   n o d e T r e e   =   t h i s . g e t N o d e T r e e ( n ) ;  
 	 	 i f ( n o d e T r e e   = =   n u l l )   {   r e t u r n ;   }  
 	 	 / /   f o r m a t   t h e   o u t p u t  
 	 	 v a r   o u t p u t T r e e   =   " " ;  
 	 	 v a r   m a x   =   n o d e T r e e . l e n g t h   -   1 ;  
 	 	 f o r ( v a r   i = m a x ; i > = 0 ; i - - )   {  
 	 	 	 i f ( n o d e T r e e [ i ] . n o d e N a m e   ! =   " H T M L "   & &   n o d e T r e e [ i ] . n o d e N a m e   ! =   " B O D Y " )   {  
 	 	 	 	 o u t p u t T r e e   + =   ' < a   c l a s s = " w y s i w y g - s t a t u s b a r "   h r e f = " j a v a s c r i p t : W Y S I W Y G . s e l e c t N o d e ( \ ' '   +   n   +   ' \ ' , '   +   i   +   ' ) ; " > '   +   n o d e T r e e [ i ] . n o d e N a m e   +   ' < / a > ' ; 	  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 o u t p u t T r e e   + =   n o d e T r e e [ i ] . n o d e N a m e ;  
 	 	 	 }  
 	 	 	 i f ( i   >   0 )   {   o u t p u t T r e e   + =   "   >   " ;   }  
 	 	 }  
 	 	 	  
 	 	 / /   u p d a t e   t h e   s t a t u s   b a r   	  
 	 	 v a r   s t a t u s b a r   =   $ ( " w y s i w y g _ s t a t u s b a r _ "   +   n ) ;  
 	 	 i f ( s t a t u s b a r ) {    
 	 	 	 s t a t u s b a r . i n n e r H T M L   =   o u t p u t T r e e ;    
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   E x e c u t e   a   c o m m a n d   o n   t h e   e d i t o r   d o c u m e n t  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   c o m m a n d   T h e   e x e c C o m m a n d   ( e . g .   B o l d )  
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r  
 	   *   @ p a r a m   { S t r i n g }   v a l u e   T h e   v a l u e   w h e n   a p p l i c a b l e  
 	   * /  
 	 e x e c C o m m a n d :   f u n c t i o n ( n ,   c m d ,   v a l u e )   {  
 	 	 	 	  
 	 	 / /   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  
 	 	 t h i s . g e t E d i t o r W i n d o w ( n ) . 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   e n a b l e d  
 	 	 v a r   t e x t M o d e C o m m a n d s   =   n e w   A r r a y ( " V i e w T e x t " ,   " P r i n t " ) ;  
 	      
 	     	 / /   C h e c k   i f   i n   T e x t   m o d e   a n d   a   d i s a b l e d   c o m m a n d   e x e c u t e  
 	 	 v a r   c m d V a l i d   =   f a l s e ;  
 	 	 f o r   ( v a r   i   =   0 ;   i   <   t e x t M o d e C o m m a n d s . l e n g t h ;   i + + )   {  
 	 	 	 i f   ( t e x t M o d e C o m m a n d s [ i ]   = =   c m d )   {  
 	 	 	 	 c m d V a l i d   =   t r u e ;  
 	 	 	 }  
 	 	 }  
 	 	 i f ( t h i s . v i e w T e x t M o d e [ n ]   & &   ! c m d V a l i d )   {  
 	 	 	 a l e r t ( " Y o u   a r e   i n   T E X T   M o d e .   T h i s   f e a t u r e   h a s   b e e n   d i s a b l e d . " ) ;  
 	 	     	 r e t u r n ;  
 	 	 }    
 	 	  
 	 	 / /   r b g   t o   h e x   c o n v e r t i o n   i m p l e m e n t a t i o n   d e p e n d e n t s   o n   b r o w s e r  
 	 	 v a r   t o H e x C o l o r   =   W Y S I W Y G _ C o r e . i s M S I E   ?   W Y S I W Y G _ C o r e . _ d e c _ t o _ r g b   :   W Y S I W Y G _ C o r e . t o H e x C o l o r ;  
 	 	  
 	 	 / /   p o p u p   s c r e e n   p o s i t i o n s  
 	 	 v a r   p o p u p P o s i t i o n   =   { l e f t :   p a r s e I n t ( w i n d o w . s c r e e n . a v a i l W i d t h   /   3 ) ,   t o p :   p a r s e I n t ( w i n d o w . s c r e e n . a v a i l H e i g h t   /   3 ) } ; 	 	  
 	 	  
 	 	 / /   C h e c k   t h e   i n s e r t   i m a g e   p o p u p   i m p l e m e n t a t i o n  
 	 	 v a r   i m a g e P o p u p F i l e   =   t h i s . c o n f i g [ n ] . P o p u p s D i r   +   ' i n s e r t _ i m a g e . h t m l ' ;  
 	 	 v a r   i m a g e P o p u p W i d t h   =   4 0 0 ;  
 	 	 v a r   i m a g e P o p u p H e i g h t   =   2 1 0 ;  
 	 	 i f ( t y p e o f   t h i s . c o n f i g [ n ] . I m a g e P o p u p F i l e   ! =   " u n d e f i n e d "   & &   t h i s . c o n f i g [ n ] . I m a g e P o p u p F i l e   ! =   " " )   {  
 	 	 	 i m a g e P o p u p F i l e   =   t h i s . c o n f i g [ n ] . I m a g e P o p u p F i l e ;  
 	 	 }  
 	 	 i f ( t y p e o f   t h i s . c o n f i g [ n ] . I m a g e P o p u p W i d t h   & &   t h i s . c o n f i g [ n ] . I m a g e P o p u p W i d t h   >   0 )   {  
 	 	 	 i m a g e P o p u p W i d t h   =   t h i s . c o n f i g [ n ] . I m a g e P o p u p W i d t h ;  
 	 	 }  
 	 	 i f ( t y p e o f   t h i s . c o n f i g [ n ] . I m a g e P o p u p H e i g h t   & &   t h i s . c o n f i g [ n ] . I m a g e P o p u p H e i g h t   >   0 )   {  
 	 	 	 i m a g e P o p u p H e i g h t   =   t h i s . c o n f i g [ n ] . I m a g e P o p u p H e i g h t ;  
 	 	 }  
 	 	  
 	 	 / /   s w i t c h   w h i c h   a c t i o n   h a v e   t o   d o  
 	 	 s w i t c h ( c m d )   {  
 	 	 	 c a s e   " M a x i m i z e " :  
 	 	 	 	 t h i s . m a x i m i z e ( n ) ;  
 	 	 	 b r e a k ;  
 	 	 	 c a s e   " F o r m a t B l o c k " :  
 	 	 	 	 W Y S I W Y G _ C o r e . e x e c C o m m a n d ( n ,   c m d ,   " < "   +   v a l u e   +   " > " ) ;  
 	 	 	 b r e a k ;  
 	 	 	 / /   F o r e C o l o r   a n d    
 	 	 	 c a s e   " F o r e C o l o r " :  
 	 	 	 	 v a r   r g b   =   t h i s . g e t E d i t o r W i n d o w ( n ) . 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 ( c m d ) ;  
 	 	             	 v a r   c u r r e n t C o l o r   =   r g b   ! =   ' '   ?   t o H e x C o l o r ( t h i s . g e t E d i t o r W i n d o w ( n ) . 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 ( c m d ) )   :   " 0 0 0 0 0 0 " ;  
 	 	 	     	 w i n d o w . o p e n ( t h i s . c o n f i g [ 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 = '   +   c m 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 = 2 1 0 , h e i g h t = 1 6 5 , t o p = '   +   p o p u p P o s i t i o n . t o p   +   ' , l e f t = '   +   p o p u p P o s i t i o n . l e f t ) . f o c u s ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   B a c k C o l o r  
 	 	 	 c a s e   " B a c k C o l o r " :  
 	 	 	 	 v a r   c u r r e n t C o l o r   =   t o H e x C o l o r ( t h i s . g e t E d i t o r W i n d o w ( n ) . 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 ( c m d ) ) ;  
 	 	 	     	 w i n d o w . o p e n ( t h i s . c o n f i g [ 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 = '   +   c m 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 = 2 1 0 , h e i g h t = 1 6 5 , t o p = '   +   p o p u p P o s i t i o n . t o p   +   ' , l e f t = '   +   p o p u p P o s i t i o n . l e f t ) . f o c u s ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   I n s e r t I m a g e  
 	 	 	 c a s e   " I n s e r t I m a g e " :    
 	 	 	 	 w i n d o w . o p e n ( i m a g e P o p u p F i l e   +   ' ? 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 = '   +   i m a g e P o p u p W i d t h   +   ' , h e i g h t = '   +   i m a g e P o p u p H e i g h t   +   ' , t o p = '   +   p o p u p P o s i t i o n . t o p   +   ' , l e f t = '   +   p o p u p P o s i t i o n . l e f t ) . f o c u s ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   R e m o v e   I m a g e  
 	 	 	 c a s e   " R e m o v e I m a g e " :    
 	 	 	 	 t h i s . r e m o v e I m a g e ( n ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   R e m o v e   L i n k  
 	 	 	 c a s e   " R e m o v e L i n k " :    
 	 	 	 	 t h i s . r e m o v e L i n k ( n ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   R e m o v e   a   N o d e  
 	 	 	 c a s e   " R e m o v e N o d e " :    
 	 	 	 	 t h i s . r e m o v e N o d e ( n ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   C r e a t e   L i n k  
 	 	 	 c a s e   " C r e a t e L i n k " :    
 	 	 	 	 w i n d o w . o p e n ( t h i s . c o n f i g [ 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 5 0 , h e i g h t = 1 6 0 , t o p = '   +   p o p u p P o s i t i o n . t o p   +   ' , l e f t = '   +   p o p u p P o s i t i o n . l e f t ) . f o c u s ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   I n s e r t T a b l e  
 	 	 	 c a s e   " I n s e r t T a b l e " :    
 	 	 	 	 w i n d o w . o p e n ( t h i s . c o n f i g [ 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 = 5 0 0 , h e i g h t = 2 6 0 , t o p = '   +   p o p u p P o s i t i o n . t o p   +   ' , l e f t = '   +   p o p u p P o s i t i o n . l e f t ) . f o c u s ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   V i e w S o u r c e  
 	 	 	 c a s e   " V i e w S o u r c e " :    
 	 	 	 	 t h i s . v i e w S o u r c e ( n ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   V i e w T e x t  
 	 	 	 c a s e   " V i e w T e x t " :    
 	 	 	 	 t h i s . v i e w T e x t ( n ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   H e l p  
 	 	 	 c a s e   " H e l p " :  
 	 	 	 	 w i n d o w . o p e n ( t h i s . c o n f i g [ n ] . P o p u p s D i r   +   ' a b o u t . 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 5 0 , t o p = '   +   p o p u p P o s i t i o n . t o p   +   ' , l e f t = '   +   p o p u p P o s i t i o n . l e f t ) . f o c u s ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   S t r i p   a n y   H T M L   a d d e d   b y   w o r d  
 	 	 	 c a s e   " R e m o v e F o r m a t " :  
 	 	 	 	 t h i s . r e m o v e F o r m a t ( n ) ; 	  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   P r e v i e w   t h x   t o   K o r v o  
 	 	 	 c a s e   " P r e v i e w " :  
 	 	 	 	 w i n d o w . o p e n ( t h i s . c o n f i g [ n ] . P o p u p s D i r   +   ' p r e v i e w . 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 = 1 , r e s i z a b l e = 1 , w i d t h = '   +   t h i s . c o n f i g [ n ] . P r e v i e w W i d t h   +   ' , h e i g h t = '   +   t h i s . c o n f i g [ n ] . P r e v i e w H e i g h t   +   ' , t o p = '   +   p o p u p P o s i t i o n . t o p   +   ' , l e f t = '   +   p o p u p P o s i t i o n . l e f t ) . f o c u s ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   P r i n t  
 	 	 	 c a s e   " P r i n t " :  
 	 	 	 	 t h i s . p r i n t ( n ) ;  
 	 	 	 b r e a k ;  
 	 	 	  
 	 	 	 / /   S a v e  
 	 	 	 c a s e   " S a v e " :  
 	 	 	         W Y S I W Y G . u p d a t e T e x t A r e a ( n ) ;  
 	 	 	         v a r   f o r m   =   W Y S I W Y G _ C o r e . f i n d P a r e n t N o d e ( " F O R M " ,   t h i s . g e t E d i t o r ( n ) ) ;  
 	 	 	         i f ( f o r m   = =   n u l l )   {  
 	 	 	         	 a l e r t ( " C a n   n o t   s u b m i t   t h e   c o n t e n t ,   b e c a u s e   n o   f o r m   e l e m e n t   f o u n d . " ) ;  
 	 	 	         	 r e t u r n ;  
 	 	 	         }  
 	 	 	         f o r m . s u b m i t ( ) ;  
 	 	 	 b r e a k ;  
 	 	 	                    
 	 	 	 / /   R e t u r n  
 	 	 	 c a s e   " R e t u r n " :  
 	 	 	       l o c a t i o n . r e p l a c e ( t h i s . c o n f i g [ n ] . O p e n e r ) ;  
 	 	 	 b r e a k ;  
 	 	 	 	 	 	  
 	 	 	 d e f a u l t :    
 	 	 	 	 W Y S I W Y G _ C o r e . e x e c C o m m a n d ( n ,   c m d ,   v a l u e ) ;  
 	 	 	 	  
 	 	 }  
 	   	 	  
 	 	 / /   h i d e   n o d e   t h e   f o n t   +   f o n t   s i z e   s e l e c t i o n  
 	 	 t h i s . c l o s e D r o p D o w n s ( n ) ;  
 	 } , 	  
 	  
 	 / * *  
 	   *   M a x i m i z e   t h e   e d i t o r   i n s t a n c e  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r  
 	   * /  
 	 m a x i m i z e :   f u n c t i o n ( n )   {  
 	 	  
 	 	 v a r   d i v E l m   =   t h i s . g e t E d i t o r D i v ( n ) ;  
 	 	 v a r   t a b l e E l m   =   t h i s . g e t E d i t o r T a b l e ( n ) ;  
 	 	 v a r   e d i t o r   =   t h i s . g e t E d i t o r ( n ) ;  
 	 	 v a r   s e t t i n g   =   t h i s . c o n f i g [ n ] ;  
 	 	 v a r   s i z e   =   W Y S I W Y G _ C o r e . w i n d o w S i z e ( ) ;  
 	 	 s i z e . w i d t h   - =   5 ;  
 	 	 i f ( t h i s . m a x i m i z e d [ n ] )   {  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( d i v E l m ,   " s t y l e " ,   " p o s i t i o n : s t a t i c ; z - i n d e x : 9 9 9 8 ; t o p : 0 p x ; l e f t : 0 p x ; w i d t h : "   +   s e t t i n g . W i d t h   +   " ; h e i g h t : 1 0 0 % ; " ) ;  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( t a b l e E l m ,   " s t y l e " ,   " w i d t h : "   +   s e t t i n g . W i d t h   +   " ; h e i g h t : "   +   s e t t i n g . H e i g h t   +   " ; " ) ;  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( e d i t o r ,   " s t y l e " ,   " w i d t h : 1 0 0 % ; h e i g h t : "   +   s e t t i n g . H e i g h t   +   " ; " ) ;  
 	 	 	 t h i s . m a x i m i z e d [ n ]   =   f a l s e ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( d i v E l m ,   " s t y l e " ,   " p o s i t i o n : a b s o l u t e ; z - i n d e x : 9 9 9 8 ; t o p : 0 p x ; l e f t : 0 p x ; w i d t h : "   +   s i z e . w i d t h   +   " p x ; h e i g h t : "   +   s i z e . h e i g h t   +   " p x ; " ) ;  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( t a b l e E l m ,   " s t y l e " ,   " w i d t h : 1 0 0 % ; h e i g h t : 1 0 0 % ; " ) ;  
 	 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( e d i t o r ,   " s t y l e " ,   " w i d t h : 1 0 0 % ; h e i g h t : 1 0 0 % ; " ) ;  
 	 	 	 t h i s . m a x i m i z e d [ n ]   =   t r u e ;  
 	 	 }  
  
 	 } , 	  
 	 	 	  
 	 / * *  
 	   *   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  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   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 > )  
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r  
 	   * /  
 	 i n s e r t H T M L :   f u n c t i o n ( h t m l ,   n )   { 	 	 	  
 	 	 i f   ( W Y S I W Y G _ C o r e . i s M S I E )   { 	      
 	 	 	 t h i s . g e t E d i t o r W i n d o w ( n ) . 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   s p a n   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t . c r e a t e E l e m e n t ( " s p a n " ) ;  
 	 	 	 s p a n . i n n e r H T M L   =   h t m l ;  
 	 	 	 t h i s . i n s e r t N o d e A t S e l e c t i o n ( s p a n ,   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               :   W Y S I W Y G . 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 )  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 i n s e r t N o d e A t S e l e c t i o n :   f u n c t i o n ( i n s e r t N o d e ,   n )   {  
 	  
 	 	 / /   g e t   e d i t o r   d o c u m e n t  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 / /   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   =   t h i s . g e t S e l e c t i o n ( 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 . 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 . d a t a ) ;  
 	 	 	 / /   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 ; 	  
 	 	 	 v a r   b e f o r e 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 ) ;  
 	 	 	 	  
 	 	 	 	 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 ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 t r y   {  
 	 	 	 	 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 ) ;  
 	 	 	 }  
 	 	 	 c a t c h ( e )   {  
 	 	 	 	 a l e r t ( e ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 s e l . a d d R a n g e ( r a n g e ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   P r i n t s   t h e   c o n t e n t   o f   t h e   W Y S I W Y G   e d i t o r   a r e a  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r   ( t e x t a r e a   I D )  
 	   * /  
 	 p r i n t :   f u n c t i o n ( n )   {  
 	 	 i f ( d o c u m e n t . a l l   & &   n a v i g a t o r . a p p V e r s i o n . s u b s t r i n g ( 2 2 , 2 3 ) = = 4 )   {  
 	 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 	 d o c . f o c u s ( ) ;  
 	 	 	 v a r   O L E C M D I D _ P R I N T   =   6 ;  
 	 	 	 v a r   O L E C M D E X E C O P T _ D O N T P R O M P T U S E R   =   2 ;  
 	 	 	 v a r   O L E C M D E X E C O P T _ P R O M P T U S E R   =   1 ;  
 	 	 	 v a r   W e b B r o w s e r   =   ' < o b j e c t   i d = " W e b B r o w s e r 1 "   w i d t h = " 0 "   h e i g h t = " 0 "   c l a s s i d = " C L S I D : 8 8 5 6 F 9 6 1 - 3 4 0 A - 1 1 D 0 - A 9 6 B - 0 0 C 0 4 F D 7 0 5 A 2 " > < / o b j e c t > ' ;  
 	 	 	 d o c . b o d y . i n s e r t A d j a c e n t H T M L ( ' b e f o r e E n d ' , W e b B r o w s e r ) ;  
 	 	 	 W e b B r o w s e r . E x e c W B ( O L E C M D I D _ P R I N T ,   O L E C M D E X E C O P T _ D O N T P R O M P T U S E R ) ;  
 	 	 	 W e b B r o w s e r . o u t e r H T M L   =   ' ' ;  
 	 	 }   e l s e   {  
 	 	 	 t h i s . g e t E d i t o r W i n d o w ( n ) . p r i n t ( ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   W r i t e s   t h e   c o n t e n t   o f   a n   d r o p   d o w n  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r   ( t e x t a r e a   I D )  
 	   *   @ p a r a m   { S t r i n g }   i d   D r o p   d o w n   i d e n t i f i e r  
 	   *   @ r e t u r n   { S t r i n g }   D r o p   d o w n   H T M L  
 	   * /  
 	 w r i t e D r o p D o w n :   f u n c t i o n ( n ,   i d )   {  
 	  
 	 	 v a r   d r o p d o w n   =   t h i s . c o n f i g [ n ] . D r o p D o w n s [ i d ] ;  
 	 	 v a r   t o o l b a r O b j   =   t h i s . T o o l b a r L i s t [ d r o p d o w n . i d ] ;  
 	 	 v a r   i m a g e   =   t h i s . c o n f i g [ n ] . I m a g e s D i r     +   t o o l b a r O b j [ 2 ] ;  
 	 	 v a r   i m a g e O n     =   t h i s . c o n f i g [ n ] . I m a g e s D i r   +   t o o l b a r O b j [ 3 ] ;  
 	 	 d r o p d o w n . e l e m e n t s . s o r t ( ) ;  
 	 	  
 	 	 v a r   o u t p u t   =   " " ;  
 	 	 o u t p u t   + =   ' < 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 > ' ;  
 	 	 o u t p u t   + =   ' < t d   o n M o u s e O v e r = " $ ( \ ' i m g _ '   +   d r o p d o w n . i d   +   ' _ '   +   n   +   ' \ ' ) . s r c = \ ' '   +   i m a g e O n   +   ' \ ' ; "   o n M o u s e O u t = " $ ( \ ' i m g _ '   +   d r o p d o w n . i d   +   ' _ '   +   n   +   ' \ ' ) . s r c = \ ' '   +   i m a g e   +   ' \ ' ; " > ' ;  
 	 	 o u t p u t   + =   ' < i m g   s r c = " '   +   i m a g e   +   ' "   i d = " i m g _ '   +   d r o p d o w n . i d   +   ' _ '   +   n   +   ' "   h e i g h t = " 2 0 "   o n C l i c k = " W Y S I W Y G . o p e n D r o p D o w n ( \ ' '   +   n   +   ' \ ' , \ ' '   +   d r o p d o w n . i d   +   ' \ ' ) ; "   u n s e l e c t a b l e = " o n "   b o r d e r = " 0 " > < b r > ' ;  
 	 	 o u t p u t   + =   ' < s p a n   i d = " e l m _ '   +   d r o p d o w n . i d   +   ' _ '   +   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 3 5 p x ; d i s p l a y : n o n e ; " > ' ;  
 	 	 f o r   ( v a r   i   =   0 ;   i   <   d r o p d o w n . e l e m e n t s . l e n g t h ; i + + )   {  
 	 	 	 i f   ( d r o p d o w n . e l e m e n t s [ i ] )   {  
 	 	 	 	 v a r   v a l u e   =   d r o p d o w n . e l e m e n t s [ i ] ;  
 	 	 	 	 v a r   l a b e l   =   d r o p d o w n . l a b e l . r e p l a c e ( / { v a l u e } / g i ,   v a l u e ) ;  
 	 	 	 	 / /   o u t p u t  
 	 	     	 	 o u t p u t   + =   ' < b u t t o n   t y p e = " b u t t o n "   o n C l i c k = " W Y S I W Y G . e x e c C o m m a n d ( \ ' '   +   n   +   ' \ ' , \ ' '   +   d r o p d o w n . c o m m a n d   +   ' \ ' , \ ' '   +   v a l u e   +   ' \ ' ) \ ; "   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 3 5 p x ; " > ' ;  
 	 	     	 	 o u t p u t   + =   ' < 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 > ' ;  
 	 	     	 	 o u t p u t   + =   ' < t d   a l i g n = " l e f t " > '   +   l a b e l   +   ' < / t d > ' ;  
 	 	     	 	 o u t p u t   + =   ' < / t r > < / t a b l e > < / b u t t o n > < b r > ' ; 	  
 	 	     	 }  
 	     	 }  
     	 	 o u t p u t   + =   ' < / s p a n > < / t d > < / t r > < / t a b l e > ' ; 	  
     	 	  
 	 	 r e t u r n   o u t p u t ;  
 	 } ,  
 	  
 	 / * *  
 	   *   C l o s e   a l l   d r o p   d o w n s .   Y o u   c a n   d e f i n e   a   e x c l u d e   d r o p d o w n   i d  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r   ( t e x t a r e a   I D )  
           *   @ p a r a m   { S t r i n g }   e x i d   E x c l u d e d   d r o p   d o w n   i d e n t i f i e r  
 	   * /  
 	 c l o s e D r o p D o w n s :   f u n c t i o n ( n ,   e x i d )   {  
 	 	 i f ( t y p e o f ( e x i d )   = =   " u n d e f i n e d " )   e x i d   =   " " ;  
 	 	 v a r   d r o p d o w n s   =   t h i s . c o n f i g [ n ] . D r o p D o w n s ;  
 	 	 f o r ( v a r   i d   i n   d r o p d o w n s )   {  
 	 	 	 v a r   d r o p d o w n   =   d r o p d o w n s [ i d ] ;  
 	 	 	 i f ( d r o p d o w n . i d   ! =   e x i d )   {  
 	 	 	 	 v a r   d i v I d   =   " e l m _ "   +   d r o p d o w n . i d   +   " _ "   +   n ;  
 	 	 	 	 i f ( $ ( d i v I d ) )   $ ( d i v I d ) . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	 }  
 	 	 } 	 	 	  
 	 } ,  
 	  
 	 / * *  
 	   *   O p e n   a   d e f i n e d   d r o p   d o w n  
 	   *    
           *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r   ( t e x t a r e a   I D )  
 	   *   @ p a r a m   { S t r i n g }   i d   D r o p   d o w n   i d e n t i f i e r  
 	   * /  
 	 o p e n D r o p D o w n :   f u n c t i o n ( n ,   i d )   {  
 	 	 v a r   d i v I d   =   " e l m _ "   +   i d   +   " _ "   +   n ;  
 	 	 i f ( $ ( d i v I d ) . s t y l e . d i s p l a y   = =   " n o n e " )   { 	  
 	 	 	 $ ( d i v I d ) . s t y l e . d i s p l a y   =   " b l o c k " ;    
 	 	 }  
 	 	 e l s e   {  
 	 	 	 $ ( d i v I d ) . s t y l e . d i s p l a y   =   " n o n e " ;    
 	 	 }  
 	 	 $ ( d i v I d ) . s t y l e . p o s i t i o n   =   " a b s o l u t e " ;  
 	 	 t h i s . c l o s e D r o p D o w n s ( n ,   i d ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   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  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r   ( t e x t a r e a   I D )  
 	   * /  
 	 v i e w S o u r c e :   f u n c t i o n ( n )   {  
 	 	  
 	 	 / /   d o c u m e n t  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	  
 	 	 / /   E n a b l e   t a b l e   h i g h l i g h t i n g  
 	 	 W Y S I W Y G _ T a b l e . d i s a b l e H i g h l i g h t i n g ( n ) ;  
 	 	 	  
 	 	 / /   V i e w   S o u r c e   f o r   I E   	    
 	 	 i f   ( W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 v a r   i H T M L   =   d o c . b o d y . i n n e r H T M L ;  
 	 	 	 / /   s t r i p   o f f   t h e   a b s o l u t e   u r l s  
 	 	 	 i H T M L   =   t h i s . s t r i p U R L P a t h ( n ,   i H T M L ) ;  
 	 	 	 / /   r e p l a c e   a l l   d e c i m a l   c o l o r   s t r i n g s   w i t h   h e x   d e c i m a l   c o l o r   s t r i n g s  
 	 	 	 i H T M L   =   W Y S I W Y G _ C o r e . r e p l a c e R G B W i t h H e x C o l o r ( i H T M L ) ;  
 	 	 	 d o c . 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   {  
 	     	 	 / /   r e p l a c e   a l l   d e c i m a l   c o l o r   s t r i n g s   w i t h   h e x   d e c i m a l   c o l o r   s t r i n g s  
 	 	 	 v a r   h t m l   =   W Y S I W Y G _ C o r e . r e p l a c e R G B W i t h H e x C o l o r ( d o c . b o d y . i n n e r H T M L ) ;  
 	         	 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 ( h t m l ) ;  
 	         	 d o c . b o d y . i n n e r H T M L   =   " " ;  
 	         	 d o c . 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  
 	 	 / /   V a l i d a t e   i f   E l e m e n t s   a r e   p r e s e n t  
 	 	 i f ( $ ( ' H T M L M o d e '   +   n ) )   {  
 	 	         $ ( ' 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 ' ;    
 	 	 }  
 	         i f ( $ ( ' t e x t M o d e '   +   n ) )   {  
 	 	         $ ( ' 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  
 	 	 d o c . b o d y . s t y l e . f o n t S i z e   =   " 1 2 p x " ;  
 	 	 d o c . 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 " ;    
 	 	  
 	     	 t h i s . v i e w T e x t M o d e [ n ]   =   t r u e ;  
 	 } ,  
 	 	  
 	 / * *  
 	   *   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  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   n   T h e   e d i t o r   i d e n t i f i e r   ( t e x t a r e a   I D )  
 	   * /  
 	 v i e w T e x t :   f u n c t i o n ( n )   {    
 	 	  
 	 	 / /   g e t   d o c u m e n t  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	  
 	 	 / /   V i e w   T e x t   f o r   I E   	     	    
 	 	 i f   ( W Y S I W Y G _ C o r e . i s M S I E )   {  
 	         	 v a r   i T e x t   =   d o c . b o d y . i n n e r T e x t ;  
 	         	 / /   s t r i p   o f f   t h e   a b s o l u t e   u r l s  
 	 	 	 i T e x t   =   t h i s . s t r i p U R L P a t h ( n ,   i T e x t ) ;  
 	 	 	 / /   r e p l a c e   a l l   d e c i m a l   c o l o r   s t r i n g s   w i t h   h e x   d e c i m a l   c o l o r   s t r i n g s  
 	 	 	 i T e x t   =   W Y S I W Y G _ C o r e . r e p l a c e R G B W i t h H e x C o l o r ( i T e x t ) ;  
 	         	 d o c . 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   =   d o c . 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 ( d o c . b o d y ) ;  
 	         	 / /   r e p l a c e   a l l   d e c i m a l   c o l o r   s t r i n g s   w i t h   h e x   d e c i m a l   c o l o r   s t r i n g s  
 	 	 	 h t m l   =   W Y S I W Y G _ C o r e . r e p l a c e R G B W i t h H e x C o l o r ( h t m l . t o S t r i n g ( ) ) ;  
 	         	 d o c . b o d y . i n n e r H T M L   =   h t m l ;  
 	 	 }  
 	 	  
 	 	 / /   E n a b l e   t a b l e   h i g h l i g h t i n g  
 	 	 W Y S I W Y G _ T a b l e . r e f r e s h H i g h l i g h t i n g ( n ) ;  
 	 	 	 	 	      
 	 	 / /   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  
 	 	 / /   V a l i d a t e   i f   E l e m e n t s   a r e   p r e s e n t  
 	 	 i f ( $ ( ' t e x t M o d e '   +   n ) )   {  
 	 	 	 $ ( ' 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 ' ;    
 	 	 }  
 	 	 i f ( $ ( ' H T M L M o d e '   +   n ) )   {  
 	 	 	 $ ( ' 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   ( c h a n g e d )  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( d o c . b o d y ,   " s t y l e " ,   t h i s . c o n f i g [ n ] . D e f a u l t S t y l e ) ;  
 	 	  
 	 	 t h i s . v i e w T e x t M o d e [ n ]   =   f a l s e ;  
 	 } ,  
 	 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     F u n c t i o n         :   s t r i p U R L P a t h ( )  
 	     D e s c r i p t i o n   :   S t r i p s   o f f   t h e   d e f i n e d   i m a g e   a n d   t h e   a n c h o r   u r l s   o f   t h e   g i v e n   c o n t e n t .  
 	     	 	 	 	 I t   a l s o   c a n   s t r i p   t h e   d o c u m e n t   U R L   a u t o m a t i c a l l y   i f   y o u   d e f i n e   a u t o .  
 	     U s a g e               :   W Y S I W Y G . s t r i p U R L P a t h ( c o n t e n t )  
 	     A r g u m e n t s       :   c o n t e n t     -   C o n t e n t   o n   w h i c h   t h e   s t r i p p i n g   a p p l i e s  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 s t r i p U R L P a t h :   f u n c t i o n ( n ,   c o n t e n t ,   e x a c t )   {  
 	  
 	 	 / /   p a r a m e t e r   e x a c t   i s   o p t i o n a l  
 	 	 i f ( t y p e o f   e x a c t   = =   " u n d e f i n e d " )   {  
 	 	 	 e x a c t   =   t r u e ;  
 	 	 }  
 	  
 	 	 v a r   s t r i p I m g a g e U r l   =   n u l l ;  
 	 	 v a r   s t r i p A n c h o r U r l   =   n u l l ;  
 	 	  
 	 	 / /   a d d   u r l   t o   s t r i p   o f   a n c h o r s   t o   a r r a y  
 	 	 i f ( t h i s . c o n f i g [ n ] . A n c h o r P a t h T o S t r i p   = =   " a u t o " )   {  
 	 	 	 s t r i p A n c h o r U r l   =   W Y S I W Y G _ C o r e . g e t D o c u m e n t U r l ( d o c u m e n t ) ;  
 	 	 }  
 	 	 e l s e   i f ( t h i s . c o n f i g [ n ] . A n c h o r P a t h T o S t r i p   ! =   " " )   {  
 	 	 	 s t r i p A n c h o r U r l   =   t h i s . c o n f i g [ n ] . A n c h o r P a t h T o S t r i p ;  
 	 	 }  
 	 	  
 	 	 / /   a d d   s t r i p   u r l   o f   i m a g e s   t o   a r r a y  
 	 	 i f ( t h i s . c o n f i g [ n ] . I m a g e P a t h T o S t r i p   = =   " a u t o " )   {  
 	 	 	 s t r i p I m g a g e U r l   =   W Y S I W Y G _ C o r e . g e t D o c u m e n t U r l ( d o c u m e n t ) ;  
 	 	 }  
 	 	 e l s e   i f ( t h i s . c o n f i g [ n ] . I m a g e P a t h T o S t r i p   ! =   " " )   {  
 	 	 	 s t r i p I m g a g e U r l   =   t h i s . c o n f i g [ n ] . I m a g e P a t h T o S t r i p ;  
 	 	 }  
 	 	  
 	 	 v a r   u r l ;  
 	 	 v a r   r e g e x ;  
 	 	 v a r   r e s u l t ;  
 	 	 / /   s t r i p   u r l   o f   i m a g e   p a t h  
 	 	 i f ( s t r i p I m g a g e U r l )   {  
 	 	 	 / /   e s c a p e   r e s e r v e d   c h a r a c t e r s   t o   b e   a   v a l i d   r e g e x 	  
 	 	 	 u r l   =   W Y S I W Y G _ C o r e . s t r i n g T o R e g e x ( W Y S I W Y G _ C o r e . g e t D o c u m e n t P a t h O f U r l ( s t r i p I m g a g e U r l ) ) ; 	  
 	 	 	  
 	 	 	 / /   e x a c t   r e p l a c i n g   o f   u r l .   r e g e x :   s r c = " < u r l > "  
 	 	 	 i f ( e x a c t )   {  
 	 	 	 	 r e g e x   =   e v a l ( " / ( s r c = \ " ) ( "   +   u r l   +   " ) ( [ ^ \ " ] * ) / g i " ) ;  
 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 1 $ 3 " ) ; 	  
 	 	 	 }  
 	 	 	 / /   n o t   e x e c t   r e p l a c i n g   o f   u r l .   r e g e x :   < u r l >  
 	 	 	 e l s e   {  
 	 	 	 	 r e g e x   =   e v a l ( " / ( "   +   u r l   +   " ) ( . + ) / g i " ) ;  
 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 2 " ) ; 	  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   s t r i p   a b s o l u t e   u r l s   w i t h o u t   a   h e a d i n g   s l a s h   ( " i m a g e s / p r i n t . g i f " ) 	  
 	 	 	 r e s u l t   =   W Y S I W Y G _ C o r e . g e t D o c u m e n t P a t h O f U r l ( s t r i p I m g a g e U r l ) . m a t c h ( / . + [ \ / ] { 2 , 3 } [ ^ \ / ] * / , " " ) ;  
 	 	 	 i f ( r e s u l t )   {  
 	 	 	 	 u r l   =   W Y S I W Y G _ C o r e . s t r i n g T o R e g e x ( r e s u l t [ 0 ] ) ;  
 	 	 	 	  
 	 	 	 	 / /   e x a c t   r e p l a c i n g   o f   u r l .   r e g e x :   s r c = " < u r l > "  
 	 	 	 	 i f ( e x a c t )   {  
 	 	 	 	 	 r e g e x   =   e v a l ( " / ( s r c = \ " ) ( "   +   u r l   +   " ) ( [ ^ \ " ] * ) / g i " ) ;  
 	 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 1 $ 3 " ) ;  
 	 	 	 	 }  
 	 	 	 	 / /   n o t   e x e c t   r e p l a c i n g   o f   u r l .   r e g e x :   < u r l >  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 r e g e x   =   e v a l ( " / ( "   +   u r l   +   " ) ( . + ) / g i " ) ;  
 	 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 2 " ) ; 	  
 	 	 	 	 }  
 	 	 	 } 	  
 	 	 }  
 	 	  
 	 	 / /   s t r i p   u r l   o f   i m a g e   p a t h  
 	 	 i f ( s t r i p A n c h o r U r l )   { 	 	 	 	 	 	  
 	 	 	 / /   e s c a p e   r e s e r v e d   c h a r a c t e r s   t o   b e   a   v a l i d   r e g e x 	 	  
 	 	 	 u r l   =   W Y S I W Y G _ C o r e . s t r i n g T o R e g e x ( W Y S I W Y G _ C o r e . g e t D o c u m e n t P a t h O f U r l ( s t r i p A n c h o r U r l ) ) ;  
 	 	 	  
 	 	 	 / /   s t r i p   a b s o l u t e   u r l s   w i t h   a   h e a d i n g   s l a s h   ( " / p r o d u c t / i n d e x . h t m l " )  
 	 	 	 / /   e x a c t   r e p l a c i n g   o f   u r l .   r e g e x :   s r c = " < u r l > "  
 	 	 	 i f ( e x a c t )   {  
 	 	 	 	 r e g e x   =   e v a l ( " / ( h r e f = \ " ) ( "   +   u r l   +   " ) ( [ ^ \ " ] * ) / g i " ) ;  
 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 1 $ 3 " ) ; 	  
 	 	 	 }  
 	 	 	 / /   n o t   e x e c t   r e p l a c i n g   o f   u r l .   r e g e x :   < u r l >  
 	 	 	 e l s e   {  
 	 	 	 	 r e g e x   =   e v a l ( " / ( "   +   u r l   +   " ) ( . + ) / g i " ) ;  
 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 2 " ) ; 	  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   s t r i p   a b s o l u t e   u r l s   w i t h o u t   a   h e a d i n g   s l a s h   ( " p r o d u c t / i n d e x . h t m l " ) 	  
 	 	 	 r e s u l t   =   W Y S I W Y G _ C o r e . g e t D o c u m e n t P a t h O f U r l ( s t r i p A n c h o r U r l ) . m a t c h ( / . + [ \ / ] { 2 , 3 } [ ^ \ / ] * / , " " ) ;  
 	 	 	 i f ( r e s u l t )   {  
 	 	 	 	 u r l   =   W Y S I W Y G _ C o r e . s t r i n g T o R e g e x ( r e s u l t [ 0 ] ) ;  
 	 	 	 	 / /   e x a c t   r e p l a c i n g   o f   u r l .   r e g e x :   s r c = " < u r l > "  
 	 	 	 	 i f ( e x a c t )   {  
 	 	 	 	 	 r e g e x   =   e v a l ( " / ( h r e f = \ " ) ( "   +   u r l   +   " ) ( [ ^ \ " ] * ) / g i " ) ;  
 	 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 1 $ 3 " ) ; 	  
 	 	 	 	 }  
 	 	 	 	 / /   n o t   e x e c t   r e p l a c i n g   o f   u r l .   r e g e x :   < u r l >  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 r e g e x   =   e v a l ( " / ( "   +   u r l   +   " ) ( . + ) / g i " ) ;  
 	 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 2 " ) ; 	  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   s t i p   o f f   a n c h o r   l i n k s   w i t h   # n a m e 	 	 	  
 	 	 	 u r l   =   W Y S I W Y G _ C o r e . s t r i n g T o R e g e x ( s t r i p A n c h o r U r l ) ;  
 	 	 	 / /   e x a c t   r e p l a c i n g   o f   u r l .   r e g e x :   s r c = " < u r l > "  
 	 	 	 i f ( e x a c t )   {  
 	 	 	 	 r e g e x   =   e v a l ( " / ( h r e f = \ " ) ( "   +   u r l   +   " ) ( # [ ^ \ " ] * ) / g i " ) ;  
 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 1 $ 3 " ) ;  
 	 	 	 }  
 	 	 	 / /   n o t   e x e c t   r e p l a c i n g   o f   u r l .   r e g e x :   < u r l >  
 	 	 	 e l s e   {  
 	 	 	 	 r e g e x   =   e v a l ( " / ( "   +   u r l   +   " ) ( . + ) / g i " ) ;  
 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 2 " ) ; 	  
 	 	 	 }  
 	 	 	  
 	 	 	  
 	 	 	 / /   s t i p   o f f   a n c h o r   l i n k s   w i t h   # n a m e   ( o n l y   f o r   l o c a l   s y s t e m )  
 	 	 	 u r l   =   W Y S I W Y G _ C o r e . g e t D o c u m e n t U r l ( d o c u m e n t ) ;  
 	 	 	 v a r   p o s   =   u r l . l a s t I n d e x O f ( " / " ) ;  
 	 	 	 i f ( p o s   ! =   - 1 )   {  
 	 	 	 	 u r l   =   u r l . s u b s t r i n g ( p o s   +   1 ,   u r l . l e n g t h ) ;  
 	 	 	 	 u r l   =   W Y S I W Y G _ C o r e . s t r i n g T o R e g e x ( u r l ) ;  
 	 	 	 	 / /   e x a c t   r e p l a c i n g   o f   u r l .   r e g e x :   s r c = " < u r l > "  
 	 	 	 	 i f ( e x a c t )   {  
 	 	 	 	 	 r e g e x   =   e v a l ( " / ( h r e f = \ " ) ( "   +   u r l   +   " ) ( # [ ^ \ " ] * ) / g i " ) ;  
 	 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 1 $ 3 " ) ;  
 	 	 	 	 }  
 	 	 	 	 / /   n o t   e x e c t   r e p l a c i n g   o f   u r l .   r e g e x :   < u r l >  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 r e g e x   =   e v a l ( " / ( "   +   u r l   +   " ) ( . + ) / g i " ) ;  
 	 	 	 	 	 c o n t e n t   =   c o n t e n t . r e p l a c e ( r e g e x ,   " $ 2 " ) ; 	  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   c o n t e n t ;  
 	 } , 	  
 	 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     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  
 	     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 )  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 u p d a t e T e x t A r e a :   f u n c t i o n ( n )   { 	  
 	 	 / /   o n   u p d a t e   s w i t c h   e d i t o r   b a c k   t o   h t m l   m o d e  
 	 	 i f ( t h i s . v i e w T e x t M o d e [ n ] )   {   t h i s . v i e w T e x t ( n ) ;   }  
 	 	 / /   g e t   i n n e r   H T M L  
 	 	 v a r   c o n t e n t   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t . b o d y . i n n e r H T M L ;  
 	 	 / /   s t r i p   o f f   d e f i n e d   U R L s   o n   I E  
 	 	 c o n t e n t   =   t h i s . s t r i p U R L P a t h ( n ,   c o n t e n t ) ;  
 	 	 / /   r e p l a c e   a l l   d e c i m a l   c o l o r   s t r i n g s   w i t h   h e x   c o l o r   s t r i n g s  
 	 	 c o n t e n t   =   W Y S I W Y G _ C o r e . r e p l a c e R G B W i t h H e x C o l o r ( c o n t e n t ) ;  
 	 	 / /   r e m o v e   l i n e   b r e a k s   b e f o r e   c o n t e n t   w i l l   b e   u p d a t e d  
 	 	 i f ( t h i s . c o n f i g [ n ] . R e p l a c e L i n e B r e a k s )   {   c o n t e n t   =   c o n t e n t . r e p l a c e ( / ( \ r \ n ) | ( \ n ) / i g ,   " " ) ;   }  
 	 	 / /   s e t   c o n t e n t   b a c k   i n   t e x t a r e a  
 	 	 $ ( n ) . v a l u e   =   c o n t e n t ;  
 	 } ,  
 	 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     F u n c t i o n         :   h i d e T o o l b a r s ( )  
 	     D e s c r i p t i o n   :   H i d e   a l l   t o o l b a r s  
 	     U s a g e               :   W Y S I W Y G . h i d e T o o l b a r 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 )  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 h i d e T o o l b a r s :   f u n c t i o n ( n )   {  
 	 	 f o r ( v a r   i = 0 ; i < t h i s . c o n f i g [ n ] . T o o l b a r . l e n g t h ; i + + )   {  
 	 	 	 v a r   t o o l b a r   =   $ ( " t o o l b a r "   +   i   +   " _ "   +   n ) ;  
 	 	 	 i f ( t o o l b a r )   {   t o o l b a 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 h o w T o o l b a r s ( )  
 	     D e s c r i p t i o n   :   D i s p l a y   a l l   t o o l b a r s  
 	     U s a g e               :   W Y S I W Y G . s h o w T o o l b a r 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 )  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 s h o w T o o l b a r s :   f u n c t i o n ( n )   {  
 	 	 f o r ( v a r   i = 0 ; i < t h i s . c o n f i g [ n ] . T o o l b a r . l e n g t h ; i + + )   {  
 	 	 	 v a r   t o o l b a r   =   $ ( " t o o l b a r "   +   i   +   " _ "   +   n ) ;  
 	 	 	 i f ( t o o l b a r )   {   t o o l b a r . s t y l e . d i s p l a y   =   " " ;   }  
 	 	 } 	  
 	 } ,  
 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     F u n c t i o n         :   h i d e S t a t u s B a r ( )  
 	     D e s c r i p t i o n   :   H i d e   t h e   s t a t u s   b a r  
 	     U s a g e               :   W Y S I W Y G . h i d e S t a t u s B a r ( 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 )  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 h i d e S t a t u s B a r :   f u n c t i o n ( n )   {  
 	 	 v a r   s t a t u s b a r   =   $ ( ' w y s i w y g _ s t a t u s b a r _ '   +   n ) ;  
 	 	 i f ( s t a t u s b a r )   { 	 s t a t u s b a 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 h o w S t a t u s B a r ( )  
 	     D e s c r i p t i o n   :   D i s p l a y   t h e   s t a t u s   b a r  
 	     U s a g e               :   W Y S I W Y G . s h o w S t a t u s B a r ( 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 )  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 s h o w S t a t u s B a r :   f u n c t i o n ( n )   {  
 	 	 v a r   s t a t u s b a r   =   $ ( ' w y s i w y g _ s t a t u s b a r _ '   +   n ) ;  
 	 	 i f ( s t a t u s b a r )   {   s t a t u s b a r . s t y l e . d i s p l a y   =   " " ;   }  
 	 } ,  
 	  
 	 / * *  
 	   *   F i n d s   t h e   n o d e   w i t h   t h e   g i v e n   t a g   n a m e   i n   t h e   g i v e n   r a n g e  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   t a g N a m e   P a r e n t   t a g   t o   f i n d  
 	   *   @ p a r a m   { R a n g e }   r a n g e   C u r r e n t   r a n g e  
 	   * /  
 	 f i n d P a r e n t :   f u n c t i o n ( p a r e n t T a g N a m e ,   r a n g e ) {  
 	 	 p a r e n t T a g N a m e   =   p a r e n t T a g N a m e . t o U p p e r C a s e ( ) ;  
 	 	 v a r   r a n g e W o r k i n g ;  
 	 	 v a r   e l m W o r k i n g   =   n u l l ;  
 	 	 t r y   {  
 	 	 	 i f ( ! W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 	 v a r   n o d e   =   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 ;  
 	 	 	 	 i f ( n o d e . n o d e T y p e   ! =   3 )   {   n o d e   =   n o d e . c h i l d N o d e s [ p o s ] ;   }  
 	 	 	 	 r e t u r n   W Y S I W Y G _ C o r e . f i n d P a r e n t N o d e ( p a r e n t T a g N a m e ,   n o d e ) ;  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 e l m W o r k i n g   =   ( r a n g e . l e n g t h   >   0 )   ?   r a n g e . i t e m ( 0 ) :   r a n g e . p a r e n t E l e m e n t ( ) ; 	 	 	 	 	  
 	 	 	 	 e l m W o r k i n g   =   W Y S I W Y G _ C o r e . f i n d P a r e n t N o d e ( p a r e n t T a g N a m e ,   e l m W o r k i n g ) ;  
 	 	 	 	 i f ( e l m W o r k i n g   ! =   n u l l )   r e t u r n   e l m W o r k i n g ;  
 	 	 	 	  
 	 	 	 	 r a n g e W o r k i n g   =   r a n g e . d u p l i c a t e ( ) ;  
 	 	 	 	 r a n g e W o r k i n g . c o l l a p s e ( t r u e ) ;  
 	 	 	 	 r a n g e W o r k i n g . m o v e E n d ( " c h a r a c t e r " ,   1 ) ;  
 	 	 	 	 i f   ( r a n g e W o r k i n g . t e x t . l e n g t h > 0 )   {  
 	 	 	 	 	 w h i l e   ( r a n g e W o r k i n g . c o m p a r e E n d P o i n t s ( " E n d T o E n d " ,   r a n g e )   <   0 ) {  
 	 	 	     	 	 	 r a n g e W o r k i n g . m o v e ( " C h a r a c t e r " ) ;  
 	 	 	     	 	 	 i f   ( n u l l   ! =   t h i s . f i n d P a r e n t T a g ( p a r e n t T a g N a m e ,   r a n g e W o r k i n g ) ) {  
 	 	 	       	 	 	 	 r e t u r n   t h i s . f i n d P a r e n t T a g ( p a r e n t T a g N a m e ,   r a n g e W o r k i n g ) ;  
 	 	 	     	 	 	 }  
 	 	 	   	 	 }  
 	 	 	   	 }  
 	 	 	   	 r e t u r n   n u l l ;  
 	 	 	 }  
 	 	 }  
 	 	 c a t c h ( e )   {  
 	 	 	 r e t u r n   n u l l ;  
 	 	 }  
 	 } ,  
 	 	  
 	 / * *  
 	   *   G e t   t h e   a c u t a l l y   t a g   o f   t h e   g i v e n   r a n g e  
 	   *  
 	   *   @ p a r a m   { R a n g e }   r a n g e   C u r r e n t   r a n g e  
 	   * /  
 	 g e t T a g :   f u n c t i o n ( r a n g e )   {  
 	 	 t r y   {  
 	 	         i f ( ! W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 	 v a r   n o d e   =   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 ;  
 	 	 	 	 i f ( n o d e . n o d e T y p e   ! =   3 )   {   n o d e   =   n o d e . c h i l d N o d e s [ p o s ] ;   }  
 	 	 	 	  
 	 	 	 	 i f ( n o d e . n o d e N a m e   & &   n o d e . n o d e N a m e . s e a r c h ( / # / )   ! =   - 1 )   {  
 	 	 	 	 	 r e t u r n   n o d e . p a r e n t N o d e ;  
 	 	 	 	 }  
 	 	 	 	 r e t u r n   n o d e ;  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 i f ( r a n g e . l e n g t h   >   0 )   {  
 	 	 	 	 	 r e t u r n   r a n g e . i t e m ( 0 ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   i f ( r a n g e . p a r e n t E l e m e n t ( ) )   {  
 	 	 	 	 	 r e t u r n   r a n g e . p a r e n t E l e m e n t ( ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 r e t u r n   n u l l ;  
 	 	 }  
 	 	 c a t c h ( e )   {  
 	 	 	 r e t u r n   n u l l ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   p a r e n t   n o d e   o f   t h e   g i v e n   n o d e  
 	   *    
 	   *   @ p a r a m   { D O M E l e m e n t }   e l e m e n t   -   E l e m e n t   w h i c h   p a r e n t   w i l l   b e   r e t u r n e d  
 	   * /  
 	 g e t P a r e n t :   f u n c t i o n ( e l e m e n t )   {  
 	 	 i f ( e l e m e n t . p a r e n t N o d e )   {  
 	 	 	 r e t u r n   e l e m e n t . p a r e n t N o d e ;  
 	 	 }  
 	 	 r e t u r n   n u l l ;  
 	 } ,  
 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     F u n c t i o n         :   g e t T e x t R a n g e ( )  
 	     D e s c r i p t i o n   :   G e t   t h e   t e x t   r a n g e   o b j e c t   o f   t h e   g i v e n   e l e m e n t  
 	     U s a g e               :   W Y S I W Y G . g e t T e x t R a n g e ( e l e m e n t )  
 	     A r g u m e n t s       :   e l e m e n t   -   A n   e l e m e n t   o f   w h i c h   y o u   g e t   t h e   t e x t   r a n g e   o b j e c t  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 g e t T e x t R a n g e :   f u n c t i o n ( e l e m e n t ) {  
 	 	 v a r   r a n g e   =   e l e m e n t . p a r e n t T e x t E d i t . c r e a t e T e x t R a n g e ( ) ;  
 	 	 r a n g e . m o v e T o E l e m e n t T e x t ( e l e m e n t ) ;  
 	 	 r e t u r n   r a n g e ;  
 	 } ,  
 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     F u n c t i o n         :   i n v e r t I E L i n e B r e a k C a p a b i l i t y ( )  
 	     D e s c r i p t i o n   :   I n v e r t s   t h e   l i n e   b r e a k   c a p a b i l i t y   o f   I E   ( T h x   t o   r i c h y r i c h )  
 	     	 	 	 	 N o r m a l :   E N T E R   =   < p >   ,   S H I F T   +   E N T E R   =   < b r >  
 	     	 	 	 	 I n v e r t e d :   E N T E R   =   < b r > ,   S H I F T   +   E N T E R   =   < p >  
 	     U s a g e               :   W Y S I W Y G . i n v e r t I E L i n e B r e a k C a p a b i l i t y ( 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 )  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 i n v e r t I E L i n e B r e a k C a p a b i l i t y :   f u n c t i o n ( n )   {  
 	  
 	 	 v a r   e d i t o r   =   t h i s . g e t E d i t o r W i n d o w ( n ) ;  
 	 	 v a r   s e l ;  
 	 	 / /   v a l i d a t e   i f   t h e   p r e s s   k e y   i s   t h e   c a r r i a g e   r e t u r n   k e y  
 	 	 i f   ( e d i t o r . e v e n t . k e y C o d e = = 1 3 )   {  
 	         	 i f   ( ! e d i t o r . e v e n t . s h i f t K e y )   {  
 	 	 	 	 s e l   =   t h i s . g e t R a n g e ( t h i s . g e t S e l e c t i o n ( n ) ) ;  
 	                         s e l . p a s t e H T M L ( " < b r > " ) ;  
 	                         e d i t o r . e v e n t . c a n c e l B u b b l e   =   t r u e ;  
 	                         e d i t o r . e v e n t . r e t u r n V a l u e   =   f a l s e ;  
 	                         s e l . s e l e c t ( ) ;  
 	                         s e l . m o v e E n d ( " c h a r a c t e r " ,   1 ) ;  
 	                         s e l . m o v e S t a r t ( " c h a r a c t e r " ,   1 ) ;  
 	                         s e l . c o l l a p s e ( f a l s e ) ;  
 	                         r e t u r n   f a l s e ;  
 	 	 	 }  
 	                 e l s e   {  
 	                         s e l   =   t h i s . g e t R a n g e ( t h i s . g e t S e l e c t i o n ( n ) ) ;  
 	                         s e l . p a s t e H T M L ( " < p > " ) ;  
 	                         e d i t o r . e v e n t . c a n c e l B u b b l e   =   t r u e ;  
 	                         e d i t o r . e v e n t . r e t u r n V a l u e   =   f a l s e ;  
 	                         s e l . s e l e c t ( ) ;  
 	                         s e l . m o v e E n d ( " c h a r a c t e r " ,   1 ) ;  
 	                         s e l . m o v e S t a r t ( " c h a r a c t e r " ,   1 ) ;  
 	                         s e l . c o l l a p s e ( f a l s e ) ;  
 	                         r e t u r n   f a l s e ;  
 	         	 }  
 	 	 }      
 	 } ,  
 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     F u n c t i o n         :   s e l e c t N o d e ( )  
 	     D e s c r i p t i o n   :   S e l e c t   a   n o d e   w i t h i n   t h e   c u r r e n t   e d i t o r  
 	     U s a g e               :   W Y S I W Y G . s e l e c t N o d e ( n ,   l e v e l )  
 	     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 )  
 	     	 	 	 	 l e v e l   -   i d e n t i f i e s   t h e   l e v e l   o f   t h e   e l e m e n t   w h i c h   w i l l   b e   s e l e c t e d  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 s e l e c t N o d e :   f u n c t i o n ( n ,   l e v e l )   {  
 	 	  
 	 	 v a r   s e l   =   t h i s . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   t h i s . g e t R a n g e ( s e l ) ;  
 	 	 v a r   p a r e n t n o d e   =   t h i s . g e t T a g ( r a n g e ) ;  
 	 	 v a r   i   =   0 ;  
 	 	  
 	 	 f o r   ( v a r   n o d e = p a r e n t n o d e ;   ( n o d e   & &   ( n o d e . n o d e T y p e   = =   1 ) ) ;   n o d e = n o d e . p a r e n t N o d e )   {  
 	 	 	 i f   ( i   = =   l e v e l )   {  
 	 	 	 	 t h i s . n o d e S e l e c t i o n ( n ,   n o d e ) ;  
 	 	 	 }  
 	 	 	 i + + ;  
 	 	 }  
 	 	  
 	 	 t h i s . u p d a t e S t a t u s B a r ( n ) ;  
 	 } ,  
 	  
 	 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * \  
 	     F u n c t i o n         :   n o d e S e l e c t i o n ( )  
 	     D e s c r i p t i o n   :   D o   t h e   n o d e   s e l e c t i o n  
 	     U s a g e               :   W Y S I W Y G . n o d e S e l e c t i o n ( n ,   n o d e )  
 	     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 )  
 	     	 	 	 	 n o d e   -   T h e   n o d e   w h i c h   w i l l   b e   s e l e c t e d  
 	 \ *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
 	 n o d e S e l e c t i o n :   f u n c t i o n ( n ,   n o d e )   {  
 	 	  
 	 	 v a r   d o c   =   t h i s . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 v a r   s e l   =   t h i s . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   t h i s . g e t R a n g e ( s e l ) ;  
 	 	  
 	 	 i f ( ! W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 i f   ( n o d e . n o d e N a m e   = =   " B O D Y " )   {  
 	 	 	 	 r a n g e . s e l e c t N o d e C o n t e n t s ( n o d e ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 r a n g e . s e l e c t N o d e ( n o d e ) ;  
 	 	 	 }  
  
 	 	 	 / *  
 	 	 	 i f   ( e n d N o d e )   {  
 	 	 	 	 t r y   {  
 	 	 	 	 	 r a n g e . s e t S t a r t ( n o d e ,   s t a r t O f f s e t ) ;  
 	 	 	 	 	 r a n g e . s e t E n d ( e n d N o d e ,   e n d O f f s e t ) ;  
 	 	 	 	 }   c a t c h ( e )   {  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 * /  
 	 	 	  
 	 	 	 i f   ( s e l )   {   s e l . r e m o v e A l l R a n g e s ( ) ;   }  
 	 	 	 i f   ( s e l )   {   s e l . a d d R a n g e ( r a n g e ) ; 	   }  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 / /   M S I E   m a y   n o t   s e l e c t   e v e r y t h i n g   w h e n   B O D Y   i s   s e l e c t e d   -    
 	 	 	 / /   s t a r t   m a y   b e   s e t   t o   f i r s t   t e x t   n o d e   i n s t e a d   o f   f i r s t   n o n - t e x t   n o d e   -    
 	 	 	 / /   n o   k n o w n   w o r k a r o u n d  
 	 	 	 i f   ( ( n o d e . n o d e N a m e   = =   " T A B L E " )   | |   ( n o d e . n o d e N a m e   = =   " I M G " )   | |   ( n o d e . n o d e N a m e   = =   " I N P U T " )   | |   ( n o d e . n o d e N a m e   = =   " S E L E C T " )   | |   ( n o d e . n o d e N a m e   = =   " T E X T A R E A " ) )   {  
 	 	 	 	 t r y   {  
 	 	 	 	 	 r a n g e   =   d o c . b o d y . c r e a t e C o n t r o l R a n g e ( ) ;  
 	 	 	 	 	 r a n g e . a d d E l e m e n t ( n o d e ) ;  
 	 	 	 	 	 r a n g e . s e l e c t ( ) ;  
 	 	 	 	 }    
 	 	 	 	 c a t c h ( e )   {   }  
 	 	 	 }    
 	 	 	 e l s e   {  
 	 	 	 	 r a n g e   =   d o c . b o d y . c r e a t e T e x t R a n g e ( ) ;  
 	 	 	 	 i f   ( r a n g e )   {  
 	 	 	 	 	 r a n g e . c o l l a p s e ( ) ;  
 	 	 	 	 	 i f   ( r a n g e . m o v e T o E l e m e n t T e x t )   {  
 	 	 	 	 	 	 t r y   {  
 	 	 	 	 	 	 	 r a n g e . m o v e T o E l e m e n t T e x t ( n o d e ) ;  
 	 	 	 	 	 	 	 r a n g e . s e l e c t ( ) ;  
 	 	 	 	 	 	 }   c a t c h ( e )   {  
 	 	 	 	 	 	 	 t r y   {  
 	 	 	 	 	 	 	 	 r a n g e   =   d o c . b o d y . c r e a t e T e x t R a n g e ( ) ;  
 	 	 	 	 	 	 	 	 r a n g e . m o v e T o E l e m e n t T e x t ( n o d e ) ;  
 	 	 	 	 	 	 	 	 r a n g e . s e l e c t ( ) ;  
 	 	 	 	 	 	 	 }    
 	 	 	 	 	 	 	 c a t c h ( e )   { }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 t r y   {  
 	 	 	 	 	 	 	 r a n g e   =   d o c . b o d y . c r e a t e T e x t R a n g e ( ) ;  
 	 	 	 	 	 	 	 r a n g e . m o v e T o E l e m e n t T e x t ( n o d e ) ;  
 	 	 	 	 	 	 	 r a n g e . s e l e c t ( ) ;  
 	 	 	 	 	 	 }    
 	 	 	 	 	 	 c a t c h ( e )   { }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 }  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
   *   o p e n W Y S I W Y G   c o r e   f u n c t i o n s   C o p y r i g h t   ( c )   2 0 0 6   o p e n W e b W a r e . c o m  
   *   C o n t a c t   u s   a t   d e v s @ o p e n w e b w a r e . c o m  
   *   T h i s   c o p y r i g h t   n o t i c e   M U S T   s t a y   i n t a c t   f o r   u s e .  
   *  
   *   $ I d :   w y s i w y g . j s , v   1 . 2 2   2 0 0 7 / 0 9 / 0 8   2 1 : 4 5 : 5 7   x h a g g i   E x p   $  
   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 v a r   W Y S I W Y G _ C o r e   =   {  
  
 	 / * *  
 	   *   H o l d s   t r u e   i f   b r o w s e r   i s   M S I E ,   o t h e r w i s e   f a l s e  
 	   * /  
 	 i s M S I E :   n a v i g a t o r . a p p 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 "   ?   t r u e   :   f a l s e ,  
  
 	 / * *  
 	   *   H o l d s   t r u e   i f   b r o w s e r   i s   F i r e f o x   ( M o z i l l a )  
 	   * /  
 	 i s F F :   ! d o c u m e n t . a l l   & &   d o c u m e n t . g e t E l e m e n t B y I d   & &   ! t h i s . i s O p e r a ,  
 	  
 	 / * *  
 	   *   H o l d s   t r u e   i f   b r o w s e r   i s   O p e r a ,   o t h e r w i s e   f a l s e  
 	   * /  
 	 i s O p e r a :   n a v i g a t o r . a p p N a m e   = =   " O p e r a "   ?   t r u e   :   f a l s e ,  
 	  
 	 / * *  
 	   *   T r i m s   w h i t e s p a c e s   o f   t h e   g i v e n   s t r i n g  
 	   *  
 	   *   @ p a r a m   s t r   S t r i n g  
 	   *   @ r e t u r n   T r i m m e d   s t r i n g  
 	   * /  
 	 t r i m :   f u n c t i o n ( s t r )   {  
 	 	 r e t u r n   s t r . r e p l a c e ( / ^ \ s * | \ s * $ / g , " " ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   D e t e r m i n e   i f   t h e   g i v e n   p a r a m e t e r   i s   d e f i n e d  
 	   *    
 	   *   @ p a r a m   p   P a r a m e t e r  
 	   *   @ r e t u r n   t r u e / f a l s e   d e p e n d e n t s   o n   d e f i n i t i o n   o f   t h e   p a r a m e t e r    
 	   * /  
 	 d e f i n e d :   f u n c t i o n ( p )   {  
 	 	 r e t u r n   t y p e o f   p   = =   " u n d e f i n e d "   ?   f a l s e   :   t r u e ; 	  
 	 } ,  
 	  
 	 / * *  
 	   *   D e t e r m i n e   i f   t h e   b r o w s e r   v e r s i o n   i s   c o m p a t i b l e  
 	   *  
 	   *   @ r e t u r n   t r u e / f a l s e   d e p e n d i n g   o n   c o m p a t i b l i t y   o f   t h e   b r o w s e r  
 	   * /  
       i s B r o w s e r C o m p a t i b l e :   f u n c t i o n ( )   {  
             / /   V a l i d a t e   b r o w s e r   a n d   c o m p a t i b l i t y  
             i f   ( ( n a v i g a t o r . u s e r A g e n t . i n d e x O f ( ' S a f a r i ' )   ! =   - 1   & &   n a v i g a t o r . u s e r A g e n t . i n d e x O f ( ' C h r o m e ' )   = =   - 1 )   | |   ! d o c u m e n t . g e t E l e m e n t B y I d   | |   ! d o c u m e n t . d e s i g n M o d e ) {        
                   / / n o   d e s i g n M o d e   ( S a f a r i   l i e s )  
                         r e t u r n   f a l s e ;  
             }  
             r e t u r n   t r u e ;  
       } ,        
 	  
 	 / * *  
 	   *   S e t   t h e   s t y l e   a t t r i b u t e   o f   t h e   g i v e n   e l e m e n t .  
 	   *   P r i v a t e   m e t h o d   t o   s o l v e   t h e   I E   b u g   w h i l e   s e t t i n g   t h e   s t y l e   a t t r i b u t e .  
 	   *  
 	   *   @ p a r a m   { D O M E l e m e n t }   n o d e   T h e   e l e m e n t   o n   w h i c h   t h e   s t y l e   a t t r i b u t e   w i l l   a f f e c t  
 	   *   @ p a r a m   { S t r i n g }   s t y l e   S t y l e s h e e t   w h i c h   w i l l   b e   s e t  
 	   * /  
 	 _ s e t S t y l e A t t r i b u t e :   f u n c t i o n ( n o d e ,   s t y l e )   {  
 	 	 i f ( s t y l e   = =   n u l l )   r e t u r n ;  
 	 	 v a r   s t y l e s   =   s t y l e . s p l i t ( " ; " ) ;  
 	 	 v a r   p o s ;  
 	 	 f o r ( v a r   i = 0 ; i < s t y l e s . l e n g t h ; i + + )   {  
 	 	 	 v a r   a t t r i b u t e s   =   s t y l e s [ i ] . s p l i t ( " : " ) ;  
 	 	 	 i f ( a t t r i b u t e s . l e n g t h   = =   2 )   {  
 	 	 	 	 t r y   {  
 	 	 	 	 	 v a r   a t t r   =   W Y S I W Y G _ C o r e . t r i m ( a t t r i b u t e s [ 0 ] ) ;  
 	 	 	 	 	 w h i l e ( ( p o s   =   a t t r . s e a r c h ( / - / ) )   ! =   - 1 )   {  
 	 	 	 	 	 	 v a r   s t r B e f o r e   =   a t t r . s u b s t r i n g ( 0 ,   p o s ) ;  
 	 	 	 	 	 	 v a r   s t r T o U p p e r C a s e   =   a t t r . s u b s t r i n g ( p o s   +   1 ,   p o s   +   2 ) ;  
 	 	 	 	 	 	 v a r   s t r A f t e r   =   a t t r . s u b s t r i n g ( p o s   +   2 ,   a t t r . l e n g t h ) ;  
 	 	 	 	 	 	 a t t r   =   s t r B e f o r e   +   s t r T o U p p e r C a s e . t o U p p e r C a s e ( )   +   s t r A f t e r ;  
 	 	 	 	 	 }  
 	 	 	 	 	 v a r   v a l u e   =   W Y S I W Y G _ C o r e . t r i m ( a t t r i b u t e s [ 1 ] ) . t o L o w e r C a s e ( ) ;  
 	 	 	 	 	 n o d e . s t y l e [ a t t r ]   =   v a l u e ;  
 	 	 	 	 }  
 	 	 	 	 c a t c h   ( e )   {  
 	 	 	 	 	 a l e r t ( e ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   F i x ' s   t h e   i s s u e   w h i l e   g e t t i n g   t h e   a t t r i b u t e   s t y l e   o n   I E  
 	   *   I t ' s   r e t u r n   a n   o b j e c t   b u t   w e   n e e d   t h e   s t y l e   s t r i n g  
 	   *  
 	   *   @ p r i v a t e  
 	   *   @ p a r a m   { D O M E l e m e n t }   n o d e   N o d e   e l e m e n t  
 	   *   @ r e t u r n   { S t r i n g }   S t y l e s h e e t  
 	   * /  
 	 _ g e t S t y l e A t t r i b u t e :   f u n c t i o n ( n o d e )   {  
 	 	 i f ( t h i s . i s M S I E )   {  
 	 	 	 r e t u r n   n o d e . s t y l e [ ' c s s T e x t ' ] . t o L o w e r C a s e ( ) ; 	 	  
 	 	 } 	  
 	 	 e l s e   {  
 	 	 	 r e t u r n   n o d e . g e t A t t r i b u t e ( " s t y l e " ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   S e t   a n   a t t r i b u t e ' s   v a l u e   o n   t h e   g i v e n   n o d e   e l e m e n t .  
 	   *  
 	   *   @ p a r a m   { D O M E l e m e n t }   n o d e   N o d e   e l e m e n t  
 	   *   @ p a r a m   { S t r i n g }   a t t r   A t t r i b u t e   w h i c h   i s   s e t  
 	   *   @ p a r a m   { S t r i n g }   v a l u e   V a l u e   o f   t h e   a t t r i b u t e  
 	   * /  
 	 s e t A t t r i b u t e :   f u n c t i o n ( n o d e ,   a t t r ,   v a l u e )   {  
 	 	 i f ( v a l u e   = =   n u l l   | |   n o d e   = =   n u l l   | |   a t t r   = =   n u l l )   r e t u r n ;  
 	 	 i f ( a t t r . t o L o w e r C a s e ( )   = =   " s t y l e " )   {  
 	 	 	 t h i s . _ s e t S t y l e A t t r i b u t e ( n o d e ,   v a l u e ) ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 n o d e . s e t A t t r i b u t e ( a t t r ,   v a l u e ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   R e m o v e s   a n   a t t r i b u t e   o n   t h e   g i v e n   n o d e  
 	   *    
 	   *   @ p a r a m   { D O M E l e m e n t }   n o d e   N o d e   e l e m e n t  
 	   *   @ p a r a m   { S t r i n g }   a t t r   A t t r i b u t e   w h i c h   w i l l   b e   r e m o v e d  
 	   * /    
 	 r e m o v e A t t r i b u t e :   f u n c t i o n ( n o d e ,   a t t r )   {  
 	 	 n o d e . r e m o v e A t t r i b u t e ( a t t r ,   f a l s e ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   v a l e   o f   t h e   a t t r i b u t e   o n   t h e   g i v e n   n o d e  
 	   *    
 	   *   @ p a r a m   { D O M E l e m e n t }   n o d e   N o d e   e l e m e n t  
 	   *   @ p a r a m   { S t r i n g }   a t t r   A t t r i b u t e   w h i c h   v a l u e   w i l l   b e   r e t u r n e d  
 	   * /  
 	 g e t A t t r i b u t e :   f u n c t i o n ( n o d e ,   a t t r )   {  
 	 	 i f ( n o d e   = =   n u l l   | |   a t t r   = =   n u l l )   r e t u r n ;  
 	 	 i f ( a t t r . t o L o w e r C a s e ( )   = =   " s t y l e " )   {  
 	 	 	 r e t u r n   t h i s . _ g e t S t y l e A t t r i b u t e ( n o d e ) ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 r e t u r n   n o d e . g e t A t t r i b u t e ( a t t r ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   p a t h   o u t   o f   a n   g i v e n   u r l  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   u r l   T h e   u r l   w i t h   i s   u s e d   t o   g e t   t h e   p a t h  
 	   * /  
 	 g e t D o c u m e n t P a t h O f U r l :   f u n c t i o n ( u r l )   {  
 	 	 v a r   p a t h   =   n u l l ;  
 	 	  
 	 	 / /   i f   l o c a l   f i l e   s y s t e m ,   c o n v e r t   l o c a l   u r l   i n t o   w e b   u r l  
 	 	 u r l   =   u r l . r e p l a c e ( / f i l e : \ / \ / / g i ,   " f i l e : / / / " ) ;  
 	 	 u r l   =   u r l . r e p l a c e ( / \ \ / g i ,   " \ / " ) ;  
 	 	 v a r   p o s   =   u r l . l a s t I n d e x O f ( " / " ) ;  
 	 	 i f ( p o s   ! =   - 1 )   {  
 	 	 	 p a t h   =   u r l . s u b s t r i n g ( 0 ,   p o s   +   1 ) ;  
 	 	 }  
 	 	 r e t u r n   p a t h ;  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   d o c u m e n t s   u r l ,   c o n v e r t   l o c a l   u r l s   t o   w e b   u r l s  
 	   *    
 	   *   @ p a r a m   { D O M E l e m e n t }   d o c   D o c u m e n t   w h i c h   i s   u s e d   t o   g e t   t h e   u r l  
 	   * /  
 	 g e t D o c u m e n t U r l :   f u n c t i o n ( d o c )   {  
 	 	 / /   i f   l o c a l   f i l e   s y s t e m ,   c o n v e r t   l o c a l   u r l   i n t o   w e b   u r l  
 	 	 v a r   u r l   =   d o c . U R L ;  
 	 	 u r l   =   u r l . r e p l a c e ( / f i l e : \ / \ / / g i ,   " f i l e : / / / " ) ;  
 	 	 u r l   =   u r l . r e p l a c e ( / \ \ / g i ,   " \ / " ) ;  
 	 	 r e t u r n   u r l ;  
 	 } ,  
 	  
 	 / * *  
 	   *   F i n d   a   p a r e n t   n o d e   w i t h   t h e   g i v e n   n a m e ,   o f   t h e   g i v e n   s t a r t   n o d e  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   t a g N a m e   -   T a g   n a m e   o f   t h e   n o d e   t o   f i n d  
 	   *   @ p a r a m   { D O M E l e m e n t }   n o d e   -   N o d e   e l e m e n t  
 	   * /  
 	 f i n d P a r e n t N o d e :   f u n c t i o n ( t a g N a m e ,   n o d e )   {  
 	 	 w h i l e   ( n o d e . t a g N a m e   ! =   " H T M L " )   {  
 	     	 	 i f   ( n o d e . t a g N a m e   = =   t a g N a m e ) {  
 	     	 	 	 r e t u r n   n o d e ;  
 	     	 	 }    
 	     	 	 n o d e   =   n o d e . p a r e n t N o d e ;  
 	   	 }  
 	   	 r e t u r n   n u l l ;  
 	 } ,  
 	  
 	 / * *  
 	   *   C a n c e l   t h e   g i v e n   e v e n t .  
 	   *  
 	   *   @ p a r a m   e   E v e n t   w h i c h   w i l l   b e   c a n c e l e d  
 	   * /  
 	 c a n c e l E v e n t :   f u n c t i o n ( e )   {  
 	 	 i f   ( ! e )   r e t u r n   f a l s e ;  
 	 	 i f   ( t h i s . i s M S I E )   {  
 	 	 	 e . r e t u r n V a l u e   =   f a l s e ;  
 	 	 	 e . c a n c e l B u b b l e   =   t r u e ;  
 	 	 }   e l s e   {  
 	 	 	 e . p r e v e n t D e f a u l t ( ) ;  
 	 	 	 e . s t o p P r o p a g a t i o n   & &   e . s t o p P r o p a g a t i o n ( ) ;  
 	 	 }  
 	 	 r e t u r n   f a l s e ; 	  
 	 } ,  
 	  
 	 / * *  
 	   *   C o n v e r t s   a   R G B   c o l o r   s t r i n g   t o   h e x   c o l o r   s t r i n g .  
 	   *  
 	   *   @ p a r a m   c o l o r   R G B   c o l o r   s t r i n g  
 	   *   @ p a r a m   H e x   c o l o r   s t r i n g  
 	   * /  
 	 t o H e x C o l o r :   f u n c t i o n ( c o l o r )   {  
 	 	 c o l o r   =   c o l o r . r e p l a c e ( / ^ r g b / g , ' ' ) ;  
 	 	 c o l o r   =   c o l o r . r e p l a c e ( / \ ( / g , ' ' ) ;  
 	 	 c o l o r   =   c o l o r . r e p l a c e ( / \ ) / g , ' ' ) ;  
 	 	 c o l o r   =   c o l o r . r e p l a c e ( /   / g , ' ' ) ;  
 	 	 c o l o r   =   c o l o r . s p l i t ( ' , ' ) ;  
 	 	 v a r   r   =   p a r s e F l o a t ( c o l o r [ 0 ] ) . t o S t r i n g ( 1 6 ) . t o U p p e r C a s e ( ) ;  
 	 	 v a r   g   =   p a r s e F l o a t ( c o l o r [ 1 ] ) . t o S t r i n g ( 1 6 ) . t o U p p e r C a s e ( ) ;  
 	 	 v a r   b   =   p a r s e F l o a t ( c o l o r [ 2 ] ) . t o S t r i n g ( 1 6 ) . t o U p p e r C a s e ( ) ;  
 	 	 i f   ( r . l e n g t h < 2 )   {   r = ' 0 ' + r ;   }  
 	 	 i f   ( g . l e n g t h < 2 )   {   g = ' 0 ' + g ;   }  
 	 	 i f   ( b . l e n g t h < 2 )   {   b = ' 0 ' + b ;   }  
 	 	 r e t u r n   r   +   g   +   b ;  
 	 } ,  
 	  
 	 / * *  
 	   *   C o n v e r t s   a   d e c i m a l   c o l o r   t o   h e x   c o l o r   s t r i n g .  
 	   *  
 	   *   @ p a r a m   D e c i m a l   c o l o r  
 	   *   @ p a r a m   H e x   c o l o r   s t r i n g  
 	   * /  
 	 _ d e c _ t o _ r g b :   f u n c t i o n ( 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 ( ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   R e p l a c e   R G B   c o l o r   s t r i n g s   w i t h   h e x   c o l o r   s t r i n g s   w i t h i n   a   s t r i n g .  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   s t r   R G B   S t r i n g  
 	   *   @ p a r a m   { S t r i n g }   H e x   c o l o r   s t r i n g  
 	   * /  
 	 r e p l a c e R G B W i t h H e x C o l o r :   f u n c t i o n ( s t r )   {  
 	 	 i f ( s t r   = =   n u l l )   r e t u r n   " " ;  
 	 	 / /   f i n d   a l l   d e c i m a l   c o l o r   s t r i n g s  
 	 	 v a r   m a t c h e r   =   s t r . m a t c h ( / r g b \ ( [ 0 - 9   ] + , [ 0 - 9   ] + , [ 0 - 9   ] + \ ) / g i ) ;  
 	 	 i f ( m a t c h e r )   {  
 	 	 	 f o r ( v a r   j = 0 ;   j < m a t c h e r . l e n g t h ; j + + )   {  
 	 	 	 	 v a r   r e g e x   =   e v a l ( " / "   +   W Y S I W Y G _ C o r e . s t r i n g T o R e g e x ( m a t c h e r [ j ] )   +   " / g i " ) ;  
 	 	 	 	 / /   r e p l a c e   t h e   d e c i m a l   c o l o r   s t r i n g s   w i t h   h e x   c o l o r   s t r i n g s  
 	 	 	 	 s t r   =   s t r . r e p l a c e ( r e g e x ,   " # "   +   t h i s . t o H e x C o l o r ( m a t c h e r [ j ] ) ) ;  
 	 	 	 }  
 	 	 }  
 	 	 r e t u r n   s t r ;  
 	 } ,  
 	  
 	 / * *  
 	   *   E x e c u t e   t h e   g i v e n   c o m m a n d   o n   t h e   g i v e n   e d i t o r  
 	   *    
 	   *   @ p a r a m   n   T h e   e d i t o r ' s   i d e n t i f i e r  
 	   *   @ p a r a m   c m d   C o m m a n d   w h i c h   i s   e x e c u t e  
 	   * /  
 	 e x e c C o m m a n d :   f u n c t i o n ( n ,   c m d ,   v a l u e )   {  
 	 	 i f ( t y p e o f ( v a l u e )   = =   " u n d e f i n e d " )   v a l u e   =   n u l l ;  
 	 	  
 	 	 / /   f i r e f o x   B a c k C o l o r   p r o b l e m   f i x e d  
 	 	 i f ( c m d   = =   ' B a c k C o l o r '   & &   W Y S I W Y G _ C o r e . i s F F )   c m d   =   ' H i l i t e C o l o r ' ;  
 	 	  
 	 	 / /   f i r e f o x   c u t ,   p a s t e   a n d   c o p y  
 	 	 i f ( W Y S I W Y G _ C o r e . i s F F   & &   ( c m d   = =   " C u t "   | |   c m d   = =   " P a s t e "   | |   c m d   = =   " C o p y " ) )   {  
 	 	 	 t r y   {  
 	 	 	 	 W Y S I W Y G . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t . e x e c C o m m a n d ( c m d ,   f a l s e ,   v a l u e ) ;  
 	 	 	 }  
 	 	 	 c a t c h ( e )   {  
 	 	 	 	 i f ( c o n f i r m ( " C o p y / C u t / P a s t e   i s   n o t   a v a i l a b l e   i n   M o z i l l a   a n d   F i r e f o x \ n D o   y o u   w a n t   m o r e   i n f o r m a t i o n   a b o u t   t h i s   i s s u e ? " ) )   {  
 	 	 	 	 	 w i n d o w . o p e n ( ' h t t p : / / w w w . m o z i l l a . o r g / e d i t o r / m i d a s d e m o / s e c u r i t y p r e f s . h t m l ' ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 e l s e   {  
 	 	 	 W Y S I W Y G . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t . e x e c C o m m a n d ( c m d ,   f a l s e ,   v a l u e ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   P a r s e   a   g i v e n   s t r i n g   t o   a   v a l i d   r e g u l a r   e x p r e s s i o n  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   s t r i n g   S t r i n g   t o   b e   p a r s e d  
 	   *   @ r e t u r n   { R e g E x }   V a l i d   r e g u l a r   e x p r e s s i o n  
 	   * /  
 	 s t r i n g T o R e g e x :   f u n c t i o n ( s t r i n g )   {  
 	 	  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ / / g i ,   " \ \ / " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ ( / g i ,   " \ \ ( " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ ) / g i ,   " \ \ ) " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ [ / g i ,   " \ \ [ " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ ] / g i ,   " \ \ ] " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ + / g i ,   " \ \ + " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ $ / g i ,   " \ \ $ " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ * / g i ,   " \ \ * " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ ? / g i ,   " \ \ ? " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ ^ / g i ,   " \ \ ^ " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ b / g i ,   " \ \ \ \ b " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ B / g i ,   " \ \ \ \ B " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ d / g i ,   " \ \ \ \ d " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ B / g i ,   " \ \ \ \ B " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ D / g i ,   " \ \ \ \ D " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ f / g i ,   " \ \ \ \ f " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ n / g i ,   " \ \ \ \ n " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ r / g i ,   " \ \ \ \ r " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ t / g i ,   " \ \ \ \ t " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ v / g i ,   " \ \ \ \ v " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ s / g i ,   " \ \ \ \ s " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ S / g i ,   " \ \ \ \ S " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ w / g i ,   " \ \ \ \ w " ) ;  
 	 	 s t r i n g   =   s t r i n g . r e p l a c e ( / \ \ W / g i ,   " \ \ \ \ W " ) ;  
 	 	  
 	 	 r e t u r n   s t r i n g ; 	 	 	  
 	 } ,  
 	  
 	 / * *  
 	   *   A d d   a n   e v e n t   l i s t e n e r  
 	   *  
 	   *   @ p a r a m   o b j   O b j e c t   o n   w h i c h   t h e   e v e n t   w i l l   b e   a t t a c h e d  
 	   *   @ p a r a m   e v   K i n d   o f   e v e n t  
 	   *   @ p a r a m   f u   F u n c t i o n   w h i c h   i s   e x e c u t e   o n   t h e   e v e n t  
 	   * /  
 	 a d d E v e n t :   f u n c t i o n ( o b j ,   e v ,   f u )   {  
 	 	 i f   ( o b j . a t t a c h E v e n t )  
 	 	 	 o b j . a t t a c h E v e n t ( " o n "   +   e v ,   f u ) ;  
 	 	 e l s e  
 	 	 	 o b j . a d d E v e n t L i s t e n e r ( e v ,   f u ,   f a l s e ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   R e m o v e   a n   e v e n t   l i s t e n e r  
 	   *  
 	   *   @ p a r a m   o b j   O b j e c t   o n   w h i c h   t h e   e v e n t   w i l l   b e   a t t a c h e d  
 	   *   @ p a r a m   e v   K i n d   o f   e v e n t  
 	   *   @ p a r a m   f u   F u n c t i o n   w h i c h   i s   e x e c u t e   o n   t h e   e v e n t  
 	   * /  
 	 r e m o v e E v e n t :     f u n c t i o n ( o b j ,   e v ,   f u )   {  
 	 	 i f   ( o b j . a t t a c h E v e n t )  
 	 	 	 o b j . d e t a c h E v e n t ( " o n "   +   e v ,   f u ) ;  
 	 	 e l s e  
 	 	 	 o b j . r e m o v e E v e n t L i s t e n e r ( e v ,   f u ,   f a l s e ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   I n c l u d e s   a   j a v a s c r i p t   f i l e  
 	   *  
 	   *   @ p a r a m   f i l e   J a v a s c r i p t   f i l e   p a t h   a n d   n a m e  
 	   * /  
 	 i n c l u d e J S :   f u n c t i o n ( f i l e )   {  
 	 	 v a r   s c r i p t   =   d o c u m e n t . c r e a t e E l e m e n t ( " s c r i p t " ) ;  
 	 	 t h i s . s e t A t t r i b u t e ( s c r i p t ,   " t y p e " ,   " t e x t / j a v a s c r i p t " ) ;  
 	 	 t h i s . s e t A t t r i b u t e ( s c r i p t ,   " s r c " ,   f i l e ) ;  
 	 	 v a r   h e a d 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 ( " h e a d " ) ;  
 	 	 f o r ( v a r   i = 0 ; i < h e a d s . l e n g t h ; i + + )   {  
 	 	 	 h e a d s [ i ] . a p p e n d C h i l d ( s c r i p t ) ; 	 	  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   I n c l u d e s   a   s t y l e s h e e t   f i l e  
 	   *  
 	   *   @ p a r a m   f i l e   S t y l e s h e e t   f i l e   p a t h   a n d   n a m e  
 	   * /  
 	 i n c l u d e C S S :   f u n c t i o n ( p a t h )   {  
 	 	 v a r   l i n k   =   d o c u m e n t . c r e a t e E l e m e n t ( " l i n k " ) ;  
 	 	 t h i s . s e t A t t r i b u t e ( l i n k ,   " r e l " ,   " s t y l e s h e e t " ) ;  
 	 	 t h i s . s e t A t t r i b u t e ( l i n k ,   " t y p e " ,   " t e x t / c s s " ) ;  
 	 	 t h i s . s e t A t t r i b u t e ( l i n k ,   " h r e f " ,   p a t h ) ;  
 	 	 v a r   h e a d 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 ( " h e a d " ) ;  
 	 	 f o r ( v a r   i = 0 ; i < h e a d s . l e n g t h ; i + + )   {  
 	 	 	 h e a d s [ i ] . a p p e n d C h i l d ( l i n k ) ; 	 	  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   s c r e e n   p o s i t i o n   o f   t h e   g i v e n   e l e m e n t .  
 	   *    
 	   *   @ p a r a m   { H T M L O b j e c t }   e l m 1   E l e m e n t   w h i c h   p o s i t i o n   w i l l   b e   c a l c u l a t e  
 	   *   @ p a r a m   { H T M L O b j e c t }   e l m 2   E l e m e n t   w h i c h   i s   t h e   l a s t   o n e   b e f o r e   c a l c u l a t i o n   s t o p s  
 	   *   @ p a r a m   { O b j e c t }   L e f t   a n d   t o p   p o s i t i o n   o f   t h e   g i v e n   e l e m e n t  
 	   * /  
 	 g e t E l e m e n t P o s i t i o n :   f u n c t i o n ( e l m 1 ,   e l m 2 )   {  
 	 	 v a r   t o p   =   0 ,   l e f t   =   0 ;   	  
 	 	 w h i l e   ( e l m 1   & &   e l m 1   ! =   e l m 2 )   {  
 	 	 	 l e f t   + =   e l m 1 . o f f s e t L e f t ;  
 	 	 	 t o p   + =   e l m 1 . o f f s e t T o p ;  
 	 	 	 e l m 1   =   e l m 1 . o f f s e t P a r e n t ;  
 	 	 }  
 	 	 r e t u r n   { l e f t   :   l e f t ,   t o p   :   t o p } ;  
 	 } ,  
 	  
 	 / * *  
 	   *   G e t   t h e   w i n d o w   s i z e  
 	   *   @ p r i v a t e  
 	   * /  
 	 w i n d o w S i z e :   f u n c t i o n ( )   {  
 	 	 i f   ( w i n d o w . i n n e r W i d t h )   {  
 	     	 	 r e t u r n   { w i d t h :   w i n d o w . i n n e r W i d t h ,   h e i g h t :   w i n d o w . i n n e r H e i g h t } ;  
 	     	 }    
 	 	 e l s e   i f   ( d o c u m e n t . b o d y   & &   d o c u m e n t . b o d y . o f f s e t W i d t h )   {  
 	     	 	 r e t u r n   { 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 ,   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 } ;  
 	     	 }    
 	 	 e l s e   {  
 	     	 	 r e t u r n   { w i d t h :   0 ,   h e i g h t :   0 } ;  
 	     	 }  
 	 }  
 }  
  
 / * *  
   *   C o n t e x t   m e n u   o b j e c t  
   * /  
 v a r   W Y S I W Y G _ C o n t e x t M e n u   =   {  
 	  
 	 h t m l :   " " ,  
 	 c o n t e x t M e n u D i v :   n u l l ,  
 	  
 	 / * *  
 	   *   I n i t   f u n c t i o n  
 	   *  
 	   *   @ p a r a m   { S t r i n g }   n   E d i t o r   i d e n t i f i e r  
 	   * /  
 	 i n i t :   f u n c t i o n ( n )   {  
 	 	 v a r   d o c   =   W Y S I W Y G . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 	  
 	 	 / /   c r e a t e   c o n t e x t   m e n u   d i v  
 	 	 t h i s . c o n t e x t M e n u D i v   =   d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ;  
 	 	 t h i s . c o n t e x t M e n u D i v . c l a s s N a m e   =   " w y s i w y g - c o n t e x t - m e n u - d i v " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s e t A t t r i b u t e ( " c l a s s " ,   " w y s i w y g - c o n t e x t - m e n u - d i v " ) ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . d i s p l a y   =   " n o n e " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . p o s i t i o n   =   " a b s o l u t e " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . z I n d e x   =   9 9 9 9 ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . l e f t   =   " 0 " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . t o p   =   " 0 " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . u n s e l e c t a b l e   =   " o n " ; 	 	  
 	 	 d o c u m e n t . b o d y . i n s e r t B e f o r e ( t h i s . c o n t e x t M e n u D i v ,   d o c u m e n t . b o d y . f i r s t C h i l d ) ;  
 	 	  
 	 	 / /   b i n d   e v e n t   l i s t e n e r s  
 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( d o c ,   " c o n t e x t m e n u " ,   f u n c t i o n   c o n t e x t ( e )   {   W Y S I W Y G _ C o n t e x t M e n u . s h o w ( e ,   n ) ;   } ) ;  
 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( d o c ,   " c l i c k " ,   f u n c t i o n   c o n t e x t ( e )   {   W Y S I W Y G _ C o n t e x t M e n u . c l o s e ( ) ;   } ) ;  
 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( d o c ,   " k e y d o w n " ,   f u n c t i o n   c o n t e x t ( e )   {   W Y S I W Y G _ C o n t e x t M e n u . c l o s e ( ) ;   } ) ;  
 	 	 W Y S I W Y G _ C o r e . a d d E v e n t ( d o c u m e n t ,   " c l i c k " ,   f u n c t i o n   c o n t e x t ( e )   {   W Y S I W Y G _ C o n t e x t M e n u . c l o s e ( ) ;   } ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   S h o w   t h e   c o n t e x t   m e n u  
 	   *  
 	   *   @ p a r a m   e   E v e n t  
 	   *   @ p a r a m   n   E d i t o r   i d e n t i f i e r  
 	   * /  
 	 s h o w :   f u n c t i o n ( e ,   n )   {  
 	 	 i f ( t h i s . c o n t e x t M e n u D i v   = =   n u l l )   r e t u r n   f a l s e ;  
 	 	  
 	 	 v a r   i f r m   =   W Y S I W Y G . g e t E d i t o r ( n ) ;  
 	 	 v a r   d o c   =   W Y S I W Y G . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	  
 	 	 / /   s e t   t h e   c o n t e x t   m e n u   p o s i t i o n  
 	 	 v a r   p o s   =   W Y S I W Y G _ C o r e . g e t E l e m e n t P o s i t i o n ( i f r m ) ; 	 	  
 	 	 v a r   x   =   W Y S I W Y G _ C o r e . i s M S I E   ?   p o s . l e f t   +   e . c l i e n t X   :   p o s . l e f t   +   ( e . p a g e X   -   d o c . b o d y . s c r o l l L e f t ) ;  
 	 	 v a r   y   =   W Y S I W Y G _ C o r e . i s M S I E   ?   p o s . t o p   +   e . c l i e n t Y   :   p o s . t o p   +   ( e . p a g e Y   -   d o c . b o d y . s c r o l l T o p ) ;  
 	 	 	 	 	  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . l e f t   =   x   +   " p x " ;    
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . t o p   =   y   +   " p x " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . v i s i b i l i t y   =   " v i s i b l e " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . d i s p l a y   =   " b l o c k " ; 	  
 	 	  
 	 	 / /   c a l l   t h e   c o n t e x t   m e n u ,   m o z i l l a   n e e d s   s o m e   t i m e  
 	 	 w i n d o w . s e t T i m e o u t ( " W Y S I W Y G _ C o n t e x t M e n u . o u t p u t ( ' "   +   n   +   " ' ) " ,   1 0 ) ;  
 	 	 	  
 	 	 W Y S I W Y G _ C o r e . c a n c e l E v e n t ( e ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 } ,  
 	  
 	 / * *  
 	   *   O u t p u t   t h e   c o n t e x t   m e n u   i t e m s  
 	   *  
 	   *   @ p a r a m   n   E d i t o r   i d e n t i f i e r  
 	   * /  
 	 o u t p u t :   f u n c t i o n   ( n )   {  
 	 	 	 	 	 	 	 	 	 	 	 	  
 	 	 / /   g e t   s e l e c t i o n  
 	 	 v a r   s e l   =   W Y S I W Y G . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   W Y S I W Y G . g e t R a n g e ( s e l ) ;  
 	  
 	 	 / /   g e t   c u r r e n t   s e l e c t e d   n o d e 	 	 	 	 	  
 	 	 v a r   t a g   =   W Y S I W Y G . g e t T a g ( r a n g e ) ;  
 	 	 i f ( t a g   = =   n u l l )   {   r e t u r n ;   }  
 	 	  
 	 	 / /   c l e a r   c o n t e x t   m e n u  
 	 	 t h i s . c l e a r ( ) ;  
 	 	  
 	 	 / /   D e t e r m i n e   k i n d   o f   n o d e s  
 	 	 v a r   i s I m g   =   ( t a g . n o d e N a m e   = =   " I M G " )   ?   t r u e   :   f a l s e ;  
 	 	 v a r   i s L i n k   =   ( t a g . n o d e N a m e   = =   " A " )   ?   t r u e   :   f a l s e ;  
 	 	  
 	 	 / /   S e l e c t i o n   i s   a n   i m a g e   o r   s e l e c t i o n   i s   a   t e x t   w i t h   l e n g t h   g r e a t e r   0  
 	 	 v a r   l e n   =   0 ;  
 	 	 i f ( W Y S I W Y G _ C o r e . i s M S I E )  
 	 	 	 l e n   =   ( d o c u m e n t . s e l e c t i o n   & &   r a n g e . t e x t )   ?   r a n g e . t e x t . l e n g t h   :   0 ;  
 	 	 e l s e  
 	 	 	 l e n   =   r a n g e . t o S t r i n g ( ) . l e n g t h ;  
 	 	 v a r   s e l   =   l e n   ! =   0   | |   i s I m g ;  
 	 	  
 	 	 / /   I c o n s  
 	 	 v a r   i c o n L i n k   =   {   e n a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " c r e a t e l i n k " ] [ 3 ] ,   d i s a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " c r e a t e l i n k " ] [ 2 ] } ;  
 	 	 v a r   i c o n I m a g e   =   {   e n a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " i n s e r t i m a g e " ] [ 3 ] ,   d i s a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " i n s e r t i m a g e " ] [ 2 ] } ;  
 	 	 v a r   i c o n D e l e t e   =   {   e n a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " d e l e t e " ] [ 3 ] ,   d i s a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " d e l e t e " ] [ 2 ] } ;  
 	 	 v a r   i c o n C o p y   =   {   e n a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " c o p y " ] [ 3 ] ,   d i s a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " c o p y " ] [ 2 ] } ;  
 	 	 v a r   i c o n C u t   =   {   e n a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " c u t " ] [ 3 ] ,   d i s a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " c u t " ] [ 2 ] } ;  
 	 	 v a r   i c o n P a s t e   =   {   e n a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " p a s t e " ] [ 3 ] ,   d i s a b l e d :   W Y S I W Y G . c o n f i g [ n ] . I m a g e s D i r   +   W Y S I W Y G . T o o l b a r L i s t [ " p a s t e " ] [ 2 ] } ;  
 	 	  
 	 	 / /   C r e a t e   c o n t e x t   m e n u   h t m l  
 	 	 t h i s . h t m l   + =   ' < t a b l e   c l a s s = " w y s i w y g - c o n t e x t - m e n u "   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 " > ' ;  
 	 	  
 	 	 / /   A d d   i t e m s  
 	 	 t h i s . a d d I t e m ( n ,   ' C o p y ' ,   i c o n C o p y ,   ' C o p y ' ,   s e l ) ;  
 	 	 t h i s . a d d I t e m ( n ,   ' C u t ' ,   i c o n C u t ,   ' C u t ' ,   s e l ) ;  
 	 	 t h i s . a d d I t e m ( n ,   ' P a s t e ' ,   i c o n P a s t e ,   ' P a s t e ' ,   t r u e ) ;  
 	 	 t h i s . a d d S e p e r a t o r ( ) ;  
 	 	 t h i s . a d d I t e m ( n ,   ' I n s e r t I m a g e ' ,   i c o n I m a g e ,   ' M o d i f y   I m a g e   P r o p e r t i e s . . . ' ,   i s I m g ) ;  
 	 	 t h i s . a d d I t e m ( n ,   ' C r e a t e L i n k ' ,   i c o n L i n k ,   ' C r e a t e   o r   M o d i f y   L i n k . . . ' ,   s e l   | |   i s L i n k ) ;  
 	 	 t h i s . a d d I t e m ( n ,   ' R e m o v e N o d e ' ,   i c o n D e l e t e ,   ' R e m o v e ' ,   t r u e ) ;  
 	 	  
 	 	 t h i s . h t m l   + =   ' < / t a b l e > ' ;  
 	 	 t h i s . c o n t e x t M e n u D i v . i n n e r H T M L   =   t h i s . h t m l ;  
 	 } ,  
 	  
 	 / * *  
 	   *   C l o s e   t h e   c o n t e x t   m e n u  
 	   * /  
 	 c l o s e :   f u n c t i o n ( )   {  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 t h i s . c o n t e x t M e n u D i v . s t y l e . d i s p l a y   =   " n o n e " ;  
 	 } ,  
 	  
 	 / * *  
 	   *   C l e a r   c o n t e x t   m e n u  
 	   * /  
 	 c l e a r :   f u n c t i o n ( )   {  
 	 	 t h i s . c o n t e x t M e n u D i v . i n n e r H T M L   =   " " ;  
 	 	 t h i s . h t m l   =   " " ; 	  
 	 } ,  
 	 	  
 	 / * *  
 	   *   A d d   c o n t e x t   m e n u   i t e m    
 	   *    
 	   *   @ p a r a m   n   e d i t o r   i d e n t i f i e r  
 	   *   @ p a r a m   c m d   C o m m a n d  
 	   *   @ p a r a m   i c o n   I c o n   w h i c h   i s   d i a b l e d  
 	   *   @ p a r a m   t i t l e   T i t l e   o f   t h e   i t e m  
 	   *   @ p a r a m   d i s a b l e d   I f   i t e m   i s   d i a b l e d  
 	   * /  
 	 a d d I t e m :   f u n c t i o n ( n ,   c m d ,   i c o n ,   t i t l e ,   d i s a b l e d )   {  
 	 	 v a r   i t e m   =   ' ' ;  
 	 	  
 	 	 i f ( d i s a b l e d )   {  
 	 	 	 i t e m   + =   ' < t r > ' ;  
 	 	 	 i t e m   + =   ' < t d   c l a s s = " i c o n " > < a   h r e f = " j a v a s c r i p t : W Y S I W Y G . e x e c C o m m a n d ( \ ' '   +   n   +   ' \ ' , \ ' '   +   c m d   +   ' \ ' ,   n u l l ) ; " > < i m g   s r c = " '   +   i c o n . e n a b l e d   +   ' "   b o r d e r = " 0 " > < / a > < / t d > ' ;  
 	 	 	 i t e m   + =   ' < t d   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 = \ ' \ ' "   o n c l i c k = " W Y S I W Y G . e x e c C o m m a n d ( \ ' '   +   n   +   ' \ ' ,   \ ' '   +   c m d   +   ' \ ' ,   n u l l ) ; W Y S I W Y G _ C o n t e x t M e n u . c l o s e ( ) ; " > < a   h r e f = " j a v a s c r i p t : v o i d ( 0 ) ; " > '   +   t i t l e   +   ' < / a > < / t d > ' ;  
 	 	 	 i t e m   + =   ' < / t r > ' ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 i t e m   + =   ' < t r > ' ;  
 	 	 	 i t e m   + =   ' < t d   c l a s s = " i c o n " > < i m g   s r c = " '   +   i c o n . d i s a b l e d   +   ' "   b o r d e r = " 0 " > < / t d > ' ;  
 	 	 	 i t e m   + =   ' < t d   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 = \ ' \ ' " > < s p a n   c l a s s = " d i s a b l e d " > '   +   t i t l e   +   ' < / s p a n > < / t d > ' ;  
 	 	 	 i t e m   + =   ' < / t r > ' ;  
 	 	 }  
 	 	  
 	 	 t h i s . h t m l   + =   i t e m ;  
 	 } ,  
 	  
 	 / * *  
 	   *   A d d   s e p e r a t o r   t o   c o n t e x t   m e n u  
 	   * /  
 	 a d d S e p e r a t o r :   f u n c t i o n ( )   {  
 	 	 v a r   o u t p u t   =   ' ' ;  
 	 	 o u t p u t   + =   ' < t r > ' ;  
 	 	 o u t p u t   + =   ' < t d   c o l s p a n = " 2 "   s t y l e = " t e x t - a l i g n : c e n t e r ; " > < h r   s i z e = " 1 "   c o l o r = " # C 9 C 9 C 9 "   w i d t h = " 9 5 % " > < / t d > ' ;  
 	 	 o u t p u t   + =   ' < / t r > ' ;  
 	 	 t h i s . h t m l   + =   o u t p u t ;  
 	 }  
 }  
  
 / * *  
   *   T a b l e   o b j e c t  
   * /  
 v a r   W Y S I W Y G _ T a b l e   =   {  
  
 	 / * *  
 	   *    
 	   * /  
 	 c r e a t e :   f u n c t i o n ( n ,   t b l )   {  
 	 	  
 	 	 / /   g e t   e d i t o r  
 	 	 v a r   d o c   =   W Y S I W Y G . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 / /   g e t   s e l e c t i o n   a n d   r a n g e  
 	 	 v a r   s e l   =   W Y S I W Y G . g e t S e l e c t i o n ( n ) ;  
 	 	 v a r   r a n g e   =   W Y S I W Y G . g e t R a n g e ( s e l ) ;  
 	 	 v a r   t a b l e   =   n u l l ;  
 	 	 	 	  
 	 	 / /   g e t   e l e m e n t   f r o m   s e l e c t i o n  
 	 	 i f ( W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 i f ( s e l . t y p e   = =   " C o n t r o l "   & &   r a n g e . l e n g t h   = =   1 )   { 	  
 	 	 	 	 r a n g e   =   W Y S I W Y G . g e t T e x t R a n g e ( r a n g e ( 0 ) ) ;  
 	 	 	 	 r a n g e . s e l e c t ( ) ;  
 	 	 	 }  
 	 	 }  
  
 	 	 / /   f i n d   a   p a r e n t   T A B L E   e l e m e n t  
 	 	 / / t a b l e   =   W Y S I W Y G . f i n d P a r e n t ( " t a b l e " ,   r a n g e ) ;  
 	 	 	 	  
 	 	 / /   c h e c k   i f   p a r e n t   i s   f o u n d  
 	 	 / / v a r   u p d a t e   =   ( t a b l e   = =   n u l l )   ?   f a l s e   :   t r u e ;  
 	 	 / / i f ( ! u p d a t e )   t a b l e   =   t b l ;  
 	 	 t a b l e   =   t b l ;  
 	 	  
 	 	 / /   a d d   r o w s   a n d   c o l s  
 	 	 v a r   r o w s   =   W Y S I W Y G _ C o r e . g e t A t t r i b u t e ( t b l ,   " t m p r o w s " ) ;  
 	 	 v a r   c o l s   =   W Y S I W Y G _ C o r e . g e t A t t r i b u t e ( t b l ,   " t m p c o l s " ) ;  
 	 	 W Y S I W Y G _ C o r e . r e m o v e A t t r i b u t e ( t b l ,   " t m p r o w s " ) ;  
 	 	 W Y S I W Y G _ C o r e . r e m o v e A t t r i b u t e ( t b l ,   " t m p c o l s " ) ;  
 	 	 f o r ( v a r   i = 0 ; i < r o w s ; i + + )   {  
 	 	 	 v a r   t r   =   d o c . c r e a t e E l e m e n t ( " t r " ) ;  
 	 	 	 f o r ( v a r   j = 0 ; j < c o l s ; j + + ) {  
 	 	 	 	 v a r   t d   =   c r e a t e T D ( ) ;  
 	 	 	 	 t r . a p p e n d C h i l d ( t d ) ; 	  
 	 	 	 }  
 	 	 	 t a b l e . a p p e n d C h i l d ( t r ) ;  
 	 	 }  
 	 	  
 	 	 / /   o n   u p d a t e   e x i t   h e r e  
 	 	 / / i f ( u p d a t e )   {   r e t u r n ;   }  
 	  
 	 	 / /   C h e c k   i f   I E   o r   M o z i l l a   ( o t h e r )  
 	 	 i f   ( W Y S I W Y G _ C o r e . i s M S I E )   {  
 	 	 	 r a n g e . p a s t e H T M L ( t a b l e . o u t e r H T M L ) ;        
 	 	 }  
 	 	 e l s e   {  
 	 	 	 W Y S I W Y G . i n s e r t N o d e A t S e l e c t i o n ( t a b l e ,   n ) ;  
 	 	 }  
 	 	  
 	 	 / /   r e f r e s h   t a b l e   h i g h l i g h t i n g  
 	 	 t h i s . r e f r e s h H i g h l i g h t i n g ( n ) ;  
 	 	  
 	 	  
 	 	  
 	 	  
 	   	 / /   f u n c t i o n s  
 	 	 f u n c t i o n   c r e a t e T D ( )   {  
 	 	 	 v a r   t d   =   d o c . c r e a t e E l e m e n t ( " t d " ) ;  
 	 	 	 t d . i n n e r H T M L   =   " & n b s p ; " ;  
 	 	 	 r e t u r n   t d ;  
 	 	 }  
 	   	  
 	 } ,  
  
 	 / * *  
 	   *   E n a b l e s   t h e   t a b l e   h i g h l i g h t i n g  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 r e f r e s h H i g h l i g h t i n g :   f u n c t i o n ( n )   {  
 	 	 v a r   d o c   =   W Y S I W Y G . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 v a r   t a b l e s   =   d o c . g e t E l e m e n t s B y T a g N a m e ( " t a b l e " ) ; 	  
 	 	 f o r ( v a r   i = 0 ; i < t a b l e s . l e n g t h ; i + + )   {  
 	 	 	 t h i s . _ e n a b l e H i g h l i g h t i n g ( t a b l e s [ i ] ) ;  
 	 	 }  
 	 	 v a r   t d s   =   d o c . g e t E l e m e n t s B y T a g N a m e ( " t d " ) ; 	  
 	 	 f o r ( v a r   i = 0 ; i < t d s . l e n g t h ; i + + )   {  
 	 	 	 t h i s . _ e n a b l e H i g h l i g h t i n g ( t d s [ i ] ) ;  
 	 	 }  
 	 } ,  
 	  
 	 / * *  
 	   *   E n a b l e s   t h e   t a b l e   h i g h l i g h t i n g  
 	   *    
 	   *   @ p a r a m   { S t r i n g }   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 )  
 	   * /  
 	 d i s a b l e H i g h l i g h t i n g :   f u n c t i o n ( n )   {  
 	 	 v a r   d o c   =   W Y S I W Y G . g e t E d i t o r W i n d o w ( n ) . d o c u m e n t ;  
 	 	 v a r   t a b l e s   =   d o c . g e t E l e m e n t s B y T a g N a m e ( " t a b l e " ) ; 	  
 	 	 f o r ( v a r   i = 0 ; i < t a b l e s . l e n g t h ; i + + )   {  
 	 	 	 t h i s . _ d i s a b l e H i g h l i g h t i n g ( t a b l e s [ i ] ) ;  
 	 	 }  
 	 	 v a r   t d s   =   d o c . g e t E l e m e n t s B y T a g N a m e ( " t d " ) ; 	  
 	 	 f o r ( v a r   i = 0 ; i < t d s . l e n g t h ; i + + )   {  
 	 	 	 t h i s . _ d i s a b l e H i g h l i g h t i n g ( t d s [ i ] ) ;  
 	 	 }  
 	  
 	 } ,  
 	  
 	 / * *  
 	   *   @ p r i v a t e  
 	   * /  
 	 _ e n a b l e H i g h l i g h t i n g :   f u n c t i o n ( n o d e )   {  
 	 	 v a r   s t y l e   =   W Y S I W Y G _ C o r e . g e t A t t r i b u t e ( n o d e ,   " s t y l e " ) ; 	  
 	 	 i f ( s t y l e   = =   n u l l )   s t y l e   =   "   " ;  
 	 	 / / a l e r t ( " E N A B L E :   E L M   =   "   +   n o d e . t a g N a m e   +   " ;   S T Y L E   =   "   +   s t y l e ) ;  
 	 	 W Y S I W Y G _ C o r e . r e m o v e A t t r i b u t e ( n o d e ,   " p r e v s t y l e " ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( n o d e ,   " p r e v s t y l e " ,   s t y l e ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( n o d e ,   " s t y l e " ,   " b o r d e r : 1 p x   d a s h e d   # A A A A A A ; " ) ;  
 	 } ,  
 	  
 	 / * *  
 	   *   @ p r i v a t e  
 	   * /  
 	 _ d i s a b l e H i g h l i g h t i n g :   f u n c t i o n ( n o d e )   {  
 	 	 v a r   s t y l e   =   W Y S I W Y G _ C o r e . g e t A t t r i b u t e ( n o d e ,   " p r e v s t y l e " ) ;  
 	 	 / / a l e r t ( " D I S A B L E :   E L M   =   "   +   n o d e . t a g N a m e   +   " ;   S T Y L E   =   "   +   s t y l e ) ;  
 	 	 / /   i f   n o   p r e v s t y l e   i s   d e f i n e d ,   t h e   t a b l e   i s   n o t   i n   h i g h l i g h t i n g   m o d e  
 	 	 i f ( s t y l e   = =   n u l l   | |   s t y l e   = =   " " )   {    
 	 	 	 t h i s . _ e n a b l e H i g h l i g h t i n g ( n o d e ) ;    
 	 	 	 r e t u r n ;    
 	 	 } 	 	 	  
 	 	 W Y S I W Y G _ C o r e . r e m o v e A t t r i b u t e ( n o d e ,   " p r e v s t y l e " ) ;  
 	 	 W Y S I W Y G _ C o r e . r e m o v e A t t r i b u t e ( n o d e ,   " s t y l e " ) ;  
 	 	 W Y S I W Y G _ C o r e . s e t A t t r i b u t e ( n o d e ,   " s t y l e " ,   s t y l e ) ;  
 	 }  
 }  
  
  
 / * *  
   *   G e t   a n   e l e m e n t   b y   i t ' s   i d e n t i f i e r  
   *  
   *   @ p a r a m   i d   E l e m e n t   i d e n t i f i e r  
   * /  
 f u n c t i o n   $ ( i d )   {  
 	 r e t u r n   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
 }  
  
 / * *  
   *   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  
   *   b y   T h o r   L a r h o l m   m e @ j s c r i p t . d k  
   * /  
 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 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 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 ) ;  
 	 } ;  
 }  
  
  
  
 
