ÿþ/ *  
   *     A V I M   J a v a S c r i p t   V i e t n a m e s e   I n p u t   M e t h o d   S o u r c e   F i l e   d a t e d   0 2 - 1 1 - 2 0 0 7  
   *  
   * 	 C o p y r i g h t   ( C )   2 0 0 4 - 2 0 0 7   H i e u   T r a n   D a n g   < l t 2 h i e u 2 0 0 4   ( a t )   u s e r s   ( d o t )   s f   ( d o t )   n e t >  
   * 	 W e b s i t e : 	 h t t p : / / h d a n g . c o . u k  
   *  
   * 	 Y o u   a r e   a l l o w e d   t o   u s e   t h i s   s o f t w a r e   i n   a n y   w a y   y o u   w a n t   p r o v i d i n g :  
   * 	 	 1 .   Y o u   m u s t   r e t a i n   t h i s   c o p y r i g h t   n o t i c e   a t   a l l   t i m e  
   * 	 	 2 .   Y o u   m u s t   n o t   c l a i m   t h a t   y o u   o r   a n y   o t h e r   t h i r d   p a r t y   i s   t h e   a u t h o r  
   * 	 	       o f   t h i s   s o f t w a r e   i n   a n y   w a y .  
 * /  
  
 v a = " e m a i l " . s p l i t ( ' , ' )   / / P u t   t h e   I D   o f   t h e   f i e l d s   y o u   D O N ' T   w a n t   t o   l e t   u s e r s   t y p e   V i e t n a m e s e   i n ,   m u l t i p l e   f i e l d s   a l l o w e d ,   s e p a r a t e d   b y   a   c o m m a   ( , )  
 m e t h o d = 0   / / D e f a u l t   i n p u t   m e t h o d ,   0 = A U T O ,   1 = T E L E X ,   2 = V N I ,   3 = V I Q R ,   4 = V I Q R *  
 o n _ o f f = 1   / / S t a r t   A V I M   o n  
 d o c k s p e l l = 1   / / S t a r t   A V I M   w i t h   s p e l l   c h e c k i n g   o n  
 d a u C u = 1   / / S t a r t   A V I M   w i t h   o l d   w a y   o f   m a r k i n g   a c c e n t   ( o ` a ,   o ` e ,   u ` y )  
 u s e C o o k i e = 1   / / S e t   t h i s   t o   0   t o   N O T   u s e   c o o k i e s  
 r a d i o I D = " h i m _ a u t o , h i m _ t e l e x , h i m _ v n i , h i m _ v i q r , h i m _ v i q r 2 , h i m _ o f f , h i m _ c k s p e l l , h i m _ d a u c u " . s p l i t ( " , " )  
 v a r   a g t = n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) , a l p h a b e t = " Q W E R T Y U I O P A S D F G H J K L Z X C V B N M \   " , t h e m , s p e l l e r r , s e t C o o k i e , g e t C o o k i e , a t t a c h e d = n e w   A r r a y ( )  
 v a r   i s _ i e = ( ( a g t . i n d e x O f ( " m s i e " ) ! = - 1 ) & & ( a g t . i n d e x O f ( " o p e r a " ) = = - 1 ) ) , S , F , J , R , X , D , o c , s k , s a v e S t r , w i , f r a m e , i s _ o p e r a = f a l s e , D 2 , i s K H T M L = f a l s e  
 v a r   v e r = 0 , s u p p o r t = t r u e , c h a n g e d = f a l s e , s p e c i a l C h a n g e = f a l s e , u n i , u n i 2 , g , h , S F J R X , D A W E O , Z , A E O , m o c , t r a n g , k l = 0 , t w 5 , r a n g e = n u l l , f I D = d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( " i f r a m e " )  
 s k e y = n e w   A r r a y ( 9 7 , 2 2 6 , 2 5 9 , 1 0 1 , 2 3 4 , 1 0 5 , 1 1 1 , 2 4 4 , 4 1 7 , 1 1 7 , 4 3 2 , 1 2 1 , 6 5 , 1 9 4 , 2 5 8 , 6 9 , 2 0 2 , 7 3 , 7 9 , 2 1 2 , 4 1 6 , 8 5 , 4 3 1 , 8 9 )  
 v a r   s k e y 2 = " a , a , a , e , e , i , o , o , o , u , u , y , A , A , A , E , E , I , O , O , O , U , U , Y " . s p l i t ( ' , ' ) , A , E , O , w h i t = f a l s e , e n g l i s h = " Â  ¯Ê Ô " , l o w e n = " â ¡°ê ô " , d s 1 = " d , D " . s p l i t ( " , " ) , d b 1 = n e w   A r r a y ( 2 7 3 , 2 7 2 )  
 o s 1 = " o , O , ¡,  , ó , Ó , ò , Ò , Í, Ì, Ï, Î, õ , Õ , Û, Ú, Ý, Ü, ã, â, ß, Þ, á, à" . s p l i t ( " , " ) , o b 1 = " ô , Ô , ô , Ô , Ñ, Ð, Ó, Ò, Ù, Ø, Õ, Ô, ×, Ö, Ñ, Ð, Ó, Ò, Ù, Ø, Õ, Ô, ×, Ö" . s p l i t ( " , " )  
 m o c s 1 = " o , O , ô , Ô , u , U , ó , Ó , ò , Ò , Í, Ì, Ï, Î, õ , Õ , ú , Ú , ù , Ù , å, ä, ç, æ, i, h, Ñ, Ð, Ó, Ò, Ù, Ø, Õ, Ô, ×, Ö" . s p l i t ( " , " ) ; m o c b 1 = " ¡,  , ¡,  , °, ¯, Û, Ú, Ý, Ü, ã, â, ß, Þ, á, à, é, è, ë, ê, ñ, ð, í, ì, ï, î, Û, Ú, Ý, Ü, ã, â, ß, Þ, á, à" . s p l i t ( " , " )  
 t r a n g s 1 = " a , A , â , Â , á , Á , à , À , ¡,  , £, ¢, ã , Ã , ¥, ¤, §, ¦, ­, ¬, ©, ¨, «, ª" . s p l i t ( " , " ) ; t r a n g b 1 = " , , , , ¯, ®, ±, °, ·, ¶, ³, ², µ, ´, ¯, ®, ±, °, ·, ¶, ³, ², µ, ´" . s p l i t ( " , " )  
 a s 1 = " a , A , , , á , Á , à , À , ¡,  , £, ¢, ã , Ã , ¯, ®, ±, °, ·, ¶, ³, ², µ, ´, ¿, ¾, Á, À, Ç, Æ, Ã, Â, Å, Ä" . s p l i t ( " , " ) ; a b 1 = " â , Â , â , Â , ¥, ¤, §, ¦, ­, ¬, ©, ¨, «, ª, ¥, ¤, §, ¦, ­, ¬, ©, ¨, «, ª, é , É , è , È , ¹, ¸, », º, ½, ¼" . s p l i t ( " , " )  
 e s 1 = " e , E , é , É , è , È , ¹, ¸, », º, ½, ¼" . s p l i t ( " , " ) ; e b 1 = " ê , Ê , ¿, ¾, Á, À, Ç, Æ, Ã, Â, Å, Ä" . s p l i t ( " , " )  
 a r A = " á , à , £, ã , ¡, a , Á , À , ¢, Ã ,  , A " . s p l i t ( ' , ' ) ; m o c r A = " ó , ò , Ï, õ , Í, o , ú , ù , ç, i, å, u , Ó , Ò , Î, Õ , Ì, O , Ú , Ù , æ, h, ä, U " . s p l i t ( ' , ' ) ; e r A = " é , è , », ½, ¹, e , É , È , º, ¼, ¸, E " . s p l i t ( ' , ' ) ; o r A = " ó , ò , Ï, õ , Í, o , Ó , Ò , Î, Õ , Ì, O " . s p l i t ( ' , ' )  
 a A = " ¥, §, ©, «, ­, â , ¤, ¦, ¨, ª, ¬, Â " . s p l i t ( ' , ' ) ; m o c A = " Û, Ý, ß, á, ã, ¡, é, ë, í, ï, ñ, °, Ú, Ü, Þ, à, â,  , è, ê, ì, î, ð, ¯" . s p l i t ( ' , ' ) ; t r a n g A = " ¯, ±, ³, µ, ·, , ®, °, ², ´, ¶, " . s p l i t ( ' , ' ) ; e A = " ¿, Á, Ã, Å, Ç, ê , ¾, À, Â, Ä, Æ, Ê " . s p l i t ( ' , ' ) ; o A = " Ñ, Ó, Õ, ×, Ù, ô , Ð, Ò, Ô, Ö, Ø, Ô " . s p l i t ( ' , ' )  
  
 f u n c t i o n   n o t W o r d ( w )   {  
 	 v a r   s t r = " \   \ r \ n # , \ \ ; . : - _ ( ) < > + - * / = ? ! \ " $ % { } [ ] \ ' ~ | ^ \ @ \ & \ t " + f c c ( 1 6 0 )  
 	 r e t u r n   ( s t r . i n d e x O f ( w ) > = 0 )  
 }  
 f u n c t i o n   n a n ( w )   {  
 	 i f   ( ( i s N a N ( w ) ) | | ( w = = ' e ' ) )   r e t u r n   t r u e  
 	 e l s e   r e t u r n   f a l s e  
 }  
 f u n c t i o n   m o z G e t T e x t ( o b j )   {  
 	 v a r   v , p o s , w = " " ; g = 1  
 	 v = ( o b j . d a t a ) ? o b j . d a t a : o b j . v a l u e  
 	 i f ( v . l e n g t h < = 0 )   r e t u r n   f a l s e  
 	 i f ( ! o b j . d a t a )   {  
 	 	 i f ( ! o b j . s e t S e l e c t i o n R a n g e )   r e t u r n   f a l s e  
 	 	 p o s = o b j . s e l e c t i o n S t a r t  
 	 }   e l s e   p o s = o b j . p o s  
 	 i f ( o b j . s e l e c t i o n S t a r t ! = o b j . s e l e c t i o n E n d )   r e t u r n   n e w   A r r a y ( " " , p o s )  
 	 w h i l e ( 1 )   {  
 	 	 i f ( p o s - g < 0 )   b r e a k  
 	 	 e l s e   i f ( n o t W o r d ( v . s u b s t r ( p o s - g , 1 ) ) )   {   i f ( v . s u b s t r ( p o s - g , 1 ) = = " \ \ " )   w = v . s u b s t r ( p o s - g , 1 ) + w ;   b r e a k   }  
 	 	 e l s e   w = v . s u b s t r ( p o s - g , 1 ) + w ;   g + +  
 	 }  
 	 r e t u r n   n e w   A r r a y ( w , p o s )  
 }  
 f u n c t i o n   s t a r t ( o b j , k e y )   {  
 	 v a r   w = " " , n n c ; o c = o b j ; u n i 2 = f a l s e  
 	 i f ( m e t h o d = = 0 )   {   u n i = " D , A , E , O , W , W " . s p l i t ( ' , ' ) ;   u n i 2 = " 9 , 6 , 6 , 6 , 7 , 8 " . s p l i t ( ' , ' ) ;   D 2 = " D A W E O 6 7 8 9 "   }  
 	 e l s e   i f ( m e t h o d = = 1 )   {   u n i = " D , A , E , O , W , W " . s p l i t ( ' , ' ) ;   D 2 = " D A W E O "   }  
 	 e l s e   i f ( m e t h o d = = 2 )   {   u n i = " 9 , 6 , 6 , 6 , 7 , 8 " . s p l i t ( ' , ' ) ;   D 2 = " 6 7 8 9 "   }  
 	 e l s e   i f ( m e t h o d = = 3 )   {   u n i = " D , ^ , ^ , ^ , + , ( " . s p l i t ( ' , ' ) ;   D 2 = " D ^ + ( "   }  
 	 e l s e   i f ( m e t h o d = = 4 )   {   u n i = " D , ^ , ^ , ^ , * , ( " . s p l i t ( ' , ' ) ;   D 2 = " D ^ * ( "   }  
 	 i f ( ! i s _ i e )   {  
 	 	 k e y = f c c ( k e y . w h i c h )  
 	 	 w = m o z G e t T e x t ( o b j )  
 	 	 i f ( D 2 . i n d e x O f ( u p ( k e y ) ) > = 0 )   n n c = t r u e  
 	 	 e l s e   n n c = f a l s e  
 	 	 i f ( ( ! w ) | | ( o b j . s e l ) )   r e t u r n  
 	 	 m a i n ( w [ 0 ] , k e y , w [ 1 ] , u n i , n n c )  
 	 	 i f ( ! d o c k s p e l l )   w = m o z G e t T e x t ( o b j )  
 	 	 i f ( ( w ) & & ( u n i 2 ) & & ( ! c h a n g e d ) )   m a i n ( w [ 0 ] , k e y , w [ 1 ] , u n i 2 , n n c )  
 	 }   e l s e   {  
 	 	 o b j = i e G e t T e x t ( o b j )  
 	 	 i f ( o b j )   {  
 	 	 	 v a r   s T = o b j . c W . t e x t  
 	 	 	 w = m a i n ( o b j . c W . t e x t , k e y , 0 , u n i , f a l s e )  
 	 	 	 i f ( ( u n i 2 ) & & ( ( w = = s T ) | | ( t y p e o f ( w ) = = ' u n d e f i n e d ' ) ) )   w = m a i n ( o b j . c W . t e x t , k e y , 0 , u n i 2 , f a l s e )  
 	 	 	 i f ( w )   o b j . c W . t e x t = w  
 	 	 }  
 	 }  
 	 i f ( D 2 . i n d e x O f ( u p ( k e y ) ) > = 0 )   {  
 	 	 i f ( ! i s _ i e )   {  
 	 	 	 w = m o z G e t T e x t ( o b j )  
 	 	 	 i f ( ! w )   r e t u r n  
 	 	 	 n o r m C ( w [ 0 ] , k e y , w [ 1 ] )  
 	 	 }   e l s e   i f ( t y p e o f ( o b j ) = = " o b j e c t " )   {    
 	 	 	 o b j = i e G e t T e x t ( o b j )  
 	 	 	 i f ( o b j )   {  
 	 	 	 	 w = o b j . c W . t e x t  
 	 	 	 	 i f ( ! c h a n g e d )   {   w + = k e y ;   c h a n g e d = t r u e   }  
 	 	 	 	 o b j . c W . t e x t = w  
 	 	 	 	 w = n o r m C ( w , k e y , 0 )  
 	 	 	 	 i f ( w )   {   o b j = i e G e t T e x t ( o b j ) ;   o b j . c W . t e x t = w   }  
 	 	 	 }  
 	 	 }    
 	 }  
 }  
 f u n c t i o n   i e G e t T e x t ( o b j )   {  
 	 v a r   c a r e t = o b j . 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 ( ) , w = " "  
 	 i f ( c a r e t . t e x t )   c a r e t . t e x t = " "  
 	 e l s e   {  
 	 	 w h i l e ( 1 )   {  
 	 	 	 c a r e t . m o v e S t a r t ( " c h a r a c t e r " , - 1 )  
 	 	 	 i f ( w . l e n g t h = = c a r e t . t e x t . l e n g t h )   b r e a k  
 	 	 	 w = c a r e t . t e x t  
 	 	 	 i f ( n o t W o r d ( w . c h a r A t ( 0 ) ) )   {  
 	 	 	 	 i f ( w . c h a r C o d e A t ( 0 ) = = 1 3 )   w = w . s u b s t r ( 2 )  
 	 	 	 	 e l s e   i f ( w . c h a r A t ( 0 ) ! = " \ \ " )   w = w . s u b s t r ( 1 )  
 	 	 	 	 b r e a k  
 	 	 	 }  
 	 	 }  
 	 }  
 	 i f ( w . l e n g t h )   {  
 	 	 c a r e t . c o l l a p s e ( f a l s e )  
 	 	 c a r e t . m o v e S t a r t ( " c h a r a c t e r " , - w . l e n g t h )  
 	 	 o b j . c W = c a r e t . d u p l i c a t e ( )  
 	 	 r e t u r n   o b j  
 	 }   e l s e   r e t u r n   f a l s e  
 }  
 f u n c t i o n   i e _ r e p l a c e C h a r ( w , p o s , c )   {  
 	 v a r   r = " " , u c = 0  
 	 i f ( i s N a N ( c ) )   u c = u p ( c )  
 	 i f ( ( w h i t ) & & ( u p ( w . s u b s t r ( w . l e n g t h - p o s - 1 , 1 ) ) = = ' U ' ) & & ( p o s ! = 1 ) & & ( u p ( w . s u b s t r ( w . l e n g t h - p o s - 2 , 1 ) ) ! = ' Q ' ) )   {  
 	 	 w h i t = f a l s e  
 	 	 i f ( ( u p ( u n V ( f c c ( c ) ) ) = = "  " ) | | ( u c = = " O " ) )   {  
 	 	 	 i f ( w . s u b s t r ( w . l e n g t h - p o s - 1 , 1 ) = = ' u ' )   r = f c c ( 4 3 2 )  
 	 	 	 e l s e   r = f c c ( 4 3 1 )  
 	 	 }  
 	 	 i f ( u c = = " O " )   {  
 	 	 	 i f ( c = = " o " )   c = 4 1 7  
 	 	 	 e l s e   c = 4 1 6  
 	 	 }  
 	 }  
 	 i f ( ! i s N a N ( c ) )   {  
 	 	 c h a n g e d = t r u e ; r + = f c c ( c )  
 	 	 r e t u r n   w . s u b s t r ( 0 , w . l e n g t h - p o s - r . l e n g t h + 1 ) + r + w . s u b s t r ( w . l e n g t h - p o s + 1 )  
 	 }   e l s e   r e t u r n   w . s u b s t r ( 0 , w . l e n g t h - p o s ) + c + w . s u b s t r ( w . l e n g t h - p o s + 1 )  
 }  
 f u n c t i o n   t r ( k , w , b y , s f , i )   {  
 	 v a r   r , p o s = f i n d C ( w , k , s f )  
 	 i f ( p o s )   {  
 	 	 i f ( p o s [ 1 ] )   {  
 	 	 	 i f ( i s _ i e )   r e t u r n   i e _ r e p l a c e C h a r ( w , p o s [ 0 ] , p o s [ 1 ] )  
 	 	 	 e l s e   r e t u r n   r e p l a c e C h a r ( o c , i - p o s [ 0 ] , p o s [ 1 ] )  
 	 	 }   e l s e   {  
 	 	 	 v a r   c , p C = w . s u b s t r ( w . l e n g t h - p o s , 1 ) , c m p ; r = s f  
 	 	 	 f o r ( g = 0 ; g < r . l e n g t h ; g + + )   {  
 	 	 	 	 i f ( ( n a n ( r [ g ] ) ) | | ( r [ g ] = = " e " ) )   c m p = p C  
 	 	 	 	 e l s e   c m p = p C . c h a r C o d e A t ( 0 )  
 	 	 	 	 i f ( c m p = = r [ g ] )   {  
 	 	 	 	 	 i f ( ! n a n ( b y [ g ] ) )   c = b y [ g ]  
 	 	 	 	 	 e l s e   c = b y [ g ] . c h a r C o d e A t ( 0 )  
 	 	 	 	 	 i f ( i s _ i e )   r e t u r n   i e _ r e p l a c e C h a r ( w , p o s , c )  
 	 	 	 	 	 e l s e   r e t u r n   r e p l a c e C h a r ( o c , i - p o s , c )  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 	 r e t u r n   f a l s e  
 }  
 f u n c t i o n   m a i n ( w , k , i , a , n n c )   {  
 	 v a r   u k = u p ( k ) , b y a = n e w   A r r a y ( d b 1 , a b 1 , e b 1 , o b 1 , m o c b 1 , t r a n g b 1 ) , g o t = f a l s e , t = " d , D , a , A , a , A , o , O , u , U , e , E , o , O " . s p l i t ( " , " )  
 	 v a r   s f a = n e w   A r r a y ( d s 1 , a s 1 , e s 1 , o s 1 , m o c s 1 , t r a n g s 1 ) , b y = n e w   A r r a y ( ) , s f = n e w   A r r a y ( )  
 	 i f ( ( m e t h o d = = 2 ) | | ( ( m e t h o d = = 0 ) & & ( a [ 0 ] = = " 9 " ) ) )   {  
 	 	 D A W E O = " 6 7 8 9 " ; S F J R X = " 1 2 5 3 4 " ; S = " 1 " ; F = " 2 " ; J = " 5 " ; R = " 3 " ; X = " 4 " ; Z = " 0 " ; D = " 9 " ; F R X = " 2 3 4 " ; A E O = " 6 " ; m o c = " 7 " ; t r a n g = " 8 " ; t h e m = " 6 7 8 " ; A = " ^ " ; E = " ^ " ; O = " ^ "  
 	 }   e l s e   i f ( m e t h o d = = 3 )   {  
 	 	 D A W E O = " ^ + ( D " ; S F J R X = " ' ` . ? ~ " ; S = " ' " ; F = " ` " ; J = " . " ; R = " ? " ; X = " ~ " ; Z = " - " ; D = " D " ; F R X = " ` ? ~ " ; A E O = " ^ " ; m o c = " + " ; t r a n g = " ( " ; t h e m = " ^ + ( " ; A = " ^ " ; E = " ^ " ; O = " ^ "  
 	 }   e l s e   i f ( m e t h o d = = 4 )   {  
 	 	 D A W E O = " ^ * ( D " ; S F J R X = " ' ` . ? ~ " ; S = " ' " ; F = " ` " ; J = " . " ; R = " ? " ; X = " ~ " ; Z = " - " ; D = " D " ; F R X = " ` ? ~ " ; A E O = " ^ " ; m o c = " * " ; t r a n g = " ( " ; t h e m = " ^ * ( " ; A = " ^ " ; E = " ^ " ; O = " ^ "  
 	 }   e l s e   i f ( ( m e t h o d = = 1 ) | | ( ( m e t h o d = = 0 ) & & ( a [ 0 ] = = " D " ) ) )   {  
 	 	 S F J R X = " S F J R X " ; D A W E O = " D A W E O " ; D = ' D ' ; S = ' S ' ; F = ' F ' ; J = ' J ' ; R = ' R ' ; X = ' X ' ; Z = ' Z ' ; F R X = " F R X " ; t h e m = " A O E W " ; t r a n g = " W " ; m o c = " W " ; A = " A " ; E = " E " ; O = " O "  
 	 }  
 	 i f ( S F J R X . i n d e x O f ( u k ) > = 0 )   {  
 	 	 v a r   r e t = s r ( w , k , i ) ;   g o t = t r u e  
 	 	 i f ( r e t )   r e t u r n   r e t  
 	 }   e l s e   i f ( u k = = Z )   {  
 	 	 s f = r e p S i g n ( n u l l )  
 	 	 f o r ( h = 0 ; h < e n g l i s h . l e n g t h ; h + + )   {  
 	 	 	 s f [ s f . l e n g t h ] = l o w e n . c h a r C o d e A t ( h )  
 	 	 	 s f [ s f . l e n g t h ] = e n g l i s h . c h a r C o d e A t ( h )  
 	 	 }  
 	 	 f o r ( h = 0 ; h < 5 ; h + + )   f o r ( g = 0 ; g < s k e y . l e n g t h ; g + + )   b y [ b y . l e n g t h ] = s k e y [ g ]  
 	 	 f o r ( h = 0 ; h < t . l e n g t h ; h + + )   b y [ b y . l e n g t h ] = t [ h ]  
 	 	 g o t = t r u e  
 	 }  
 	 e l s e   f o r ( h = 0 ; h < a . l e n g t h ; h + + )   i f ( a [ h ] = = u k )   {   g o t = t r u e ;   b y = b y . c o n c a t ( b y a [ h ] ) ;   s f = s f . c o n c a t ( s f a [ h ] )   }  
 	 i f ( u k = = m o c )   w h i t = t r u e ;  
 	 i f ( ! g o t )   {  
 	 	 i f ( n n c )   r e t u r n  
 	 	 r e t u r n   n o r m C ( w , k , i )  
 	 }  
 	 r e t u r n   D A W E O Z ( k , w , b y , s f , i , u k )  
 }  
 f u n c t i o n   D A W E O Z ( k , w , b y , s f , i , u k )   {   i f ( ( D A W E O . i n d e x O f ( u k ) > = 0 ) | | ( Z . i n d e x O f ( u k ) > = 0 ) )   r e t u r n   t r ( k , w , b y , s f , i )   }  
 f u n c t i o n   n o r m C ( w , k , i )   {  
 	 v a r   u k = u p ( k ) , u = r e p S i g n ( n u l l ) , f S , c , j , s p a c e = ( k . c h a r C o d e A t ( 0 ) = = 3 2 ) ? t r u e : f a l s e  
 	 i f ( ( ! i s _ i e ) & & ( s p a c e ) )   r e t u r n  
 	 f o r ( j = 1 ; j < = w . l e n g t h ; j + + )   {  
 	 	 f o r ( h = 0 ; h < u . l e n g t h ; h + + )   {  
 	 	 	 i f ( u [ h ] = = w . c h a r C o d e A t ( w . l e n g t h - j ) )   {  
 	 	 	 	 i f ( h < = 2 3 )   f S = S  
 	 	 	 	 e l s e   i f ( h < = 4 7 )   f S = F  
 	 	 	 	 e l s e   i f ( h < = 7 1 )   f S = J  
 	 	 	 	 e l s e   i f ( h < = 9 5 )   f S = R  
 	 	 	 	 e l s e   f S = X  
 	 	 	 	 c = s k e y [ h % 2 4 ] ;   i f ( ( a l p h a b e t . i n d e x O f ( u k ) < 0 ) & & ( D 2 . i n d e x O f ( u k ) < 0 ) )   r e t u r n   w ;   w = u n V ( w )  
 	 	 	 	 i f ( ( ! s p a c e ) & & ( ! c h a n g e d ) )   w + = k  
 	 	 	 	 i f ( ! i s _ i e )   {  
 	 	 	 	 	 v a r   s p = o c . s e l e c t i o n S t a r t , p o s = s p  
 	 	 	 	 	 i f ( ! c h a n g e d )   {  
 	 	 	 	 	 	 v a r   s s t = o c . s c r o l l T o p ; p o s + = k . l e n g t h  
 	 	 	 	 	 	 i f ( ! o c . d a t a )   {   o c . v a l u e = o c . v a l u e . s u b s t r ( 0 , s p ) + k + o c . v a l u e . s u b s t r ( o c . s e l e c t i o n E n d ) ; c h a n g e d = t r u e ; o c . s c r o l l T o p = s s t   }  
 	 	 	 	 	 	 e l s e   {   o c . i n s e r t D a t a ( o c . p o s , k ) ; o c . p o s + + ; r a n g e . s e t E n d ( o c , o c . p o s ) ; s p e c i a l C h a n g e = t r u e   }  
 	 	 	 	 	 }  
 	 	 	 	 	 i f ( ! o c . d a t a )   o c . s e t S e l e c t i o n R a n g e ( p o s , p o s )  
 	 	 	 	 	 i f ( ! c k s p e l l ( w , f S ) )   {  
 	 	 	 	 	 	 r e p l a c e C h a r ( o c , i - j , c )  
 	 	 	 	 	 	 i f ( ! o c . d a t a )   {  
 	 	 	 	 	 	 	 v a r   a = n e w   A r r a y ( D )  
 	 	 	 	 	 	 	 m a i n ( w , f S , p o s , a , f a l s e )  
 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 v a r   w w = m o z G e t T e x t ( o c )  
 	 	 	 	 	 	 	 v a r   a = n e w   A r r a y ( D )  
 	 	 	 	 	 	 	 m a i n ( w w [ 0 ] , f S , w w [ 1 ] , a , f a l s e )  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 v a r   r e t = s r ( w , f S , 0 )  
 	 	 	 	 	 i f ( ( s p a c e ) & & ( r e t ) )   r e t + = f c c ( 3 2 )  
 	 	 	 	 	 i f ( r e t )   r e t u r n   r e t  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 }  
 f u n c t i o n   n o s p e l l ( w , k )   {   r e t u r n   f a l s e   }  
 f u n c t i o n   c k s p e l l ( w , k )   {  
 	 w = u n V ( w ) ;   v a r   e x c = " U O U , I E U " . s p l i t ( ' , ' ) , z , n e x t = t r u e , n o E = " U U , U O U , U O I , I E U , A O , I A , A I , A Y , A U , A O " . s p l i t ( ' , ' ) , n o B E = " Y E U " , t e s t , a , b  
 	 v a r   c h e c k = t r u e , n o M = " U E , U Y E , I U , E U , U Y " . s p l i t ( ' , ' ) , n o M T = " A Y , A U " . s p l i t ( ' , ' ) , n o T = " U A " , t = - 1 , n o t V 2 = " I A O "  
 	 v a r   u w = u p ( w ) , t w = u w , u p d a t e = f a l s e , g i = " I O " , n o A O E W = " O E , O O , A O , E O , I A , A I " . s p l i t ( ' , ' ) , n o A O E = " O A "  
 	 v a r   n o t V i e t = " A A , A E , E E , O U , Y Y , Y I , I Y , E Y , E A , E I , I I , I O , Y O , Y A , O O O " . s p l i t ( ' , ' ) , u k = u p ( k ) , t w E , u w 2 = u n V 2 ( u w )  
 	 v a r   v S C o n s o n a n t = " B , C , D , G , H , K , L , M , N , P , Q , R , S , T , V , X " . s p l i t ( ' , ' ) , v D C o n s o n a n t = " C H , G I , K H , N G H , G H , N G , N H , P H , Q U , T H , T R " . s p l i t ( ' , ' )  
 	 v a r   v D C o n s o n a n t E = " C H , N G , N H " . s p l i t ( ' , ' ) , s C o n s o n a n t = " C , P , T , C H " . s p l i t ( ' , ' ) , v S C o n s o n a n t E = " C , M , N , P , T " . s p l i t ( ' , ' )  
 	 v a r   n o N H E = " O , U , I E , Ô ,  , ¯, I Ê , , Â , U Y E , U Y Ê , U O , ¯ , ¯O , U  , U A , ¯A , O , O E , O Ê " . s p l i t ( ' , ' ) , o M o c = " U U , U O U " . s p l i t ( ' , ' )  
 	 i f ( F R X . i n d e x O f ( u k ) > = 0 )   f o r ( a = 0 ; a < s C o n s o n a n t . l e n g t h ; a + + )   i f ( u w . s u b s t r ( u w . l e n g t h - s C o n s o n a n t [ a ] . l e n g t h , s C o n s o n a n t [ a ] . l e n g t h ) = = s C o n s o n a n t [ a ] )   r e t u r n   t r u e  
 	 f o r ( a = 0 ; a < u w . l e n g t h ; a + + )   {  
 	 	 i f ( " F J Z W 1 2 3 4 5 6 7 8 9 0 " . i n d e x O f ( u w . s u b s t r ( a , 1 ) ) > = 0 )   r e t u r n   t r u e  
 	 	 f o r ( b = 0 ; b < n o t V i e t . l e n g t h ; b + + )   {  
 	 	 	 i f ( u w 2 . s u b s t r ( a , n o t V i e t [ b ] . l e n g t h ) = = n o t V i e t [ b ] )   {  
 	 	 	 	 f o r ( z = 0 ; z < e x c . l e n g t h ; z + + )   i f ( u w 2 . i n d e x O f ( e x c [ z ] ) > = 0 )   n e x t = f a l s e  
 	 	 	 	 i f ( ( n e x t ) & & ( ( g i . i n d e x O f ( n o t V i e t [ b ] ) < 0 ) | | ( a < = 0 ) | | ( u w 2 . s u b s t r ( a - 1 , 1 ) ! = ' G ' ) ) )   r e t u r n   t r u e  
 	 	 	 }  
 	 	 }  
 	 }  
 	 f o r ( b = 0 ; b < v D C o n s o n a n t . l e n g t h ; b + + )   i f ( t w . i n d e x O f ( v D C o n s o n a n t [ b ] ) = = 0 ) { t w = t w . s u b s t r ( v D C o n s o n a n t [ b ] . l e n g t h ) ; u p d a t e = t r u e ; t = b ; b r e a k }  
 	 i f ( ! u p d a t e )   f o r ( b = 0 ; b < v S C o n s o n a n t . l e n g t h ; b + + )   i f ( t w . i n d e x O f ( v S C o n s o n a n t [ b ] ) = = 0 ) { t w = t w . s u b s t r ( 1 ) ; b r e a k }  
 	 u p d a t e = f a l s e ; t w E = t w  
 	 f o r ( b = 0 ; b < v D C o n s o n a n t E . l e n g t h ; b + + )   {  
 	 	 i f ( t w . s u b s t r ( t w . l e n g t h - v D C o n s o n a n t E [ b ] . l e n g t h ) = = v D C o n s o n a n t E [ b ] )   {  
 	 	 	 t w = t w . s u b s t r ( 0 , t w . l e n g t h - v D C o n s o n a n t E [ b ] . l e n g t h )  
 	 	 	 i f ( b = = 2 ) {  
 	 	 	 	 f o r ( z = 0 ; z < n o N H E . l e n g t h ; z + + )   i f ( t w = = n o N H E [ z ] )   r e t u r n   t r u e  
 	 	 	 	 i f ( ( u k = = t r a n g ) & & ( ( t w = = " O A " ) | | ( t w = = " A " ) ) )   r e t u r n   t r u e  
 	 	 	 }  
 	 	 	 u p d a t e = t r u e ; b r e a k  
 	 	 }  
 	 }  
 	 i f ( ! u p d a t e )   f o r ( b = 0 ; b < v S C o n s o n a n t E . l e n g t h ; b + + )   i f ( t w . s u b s t r ( t w . l e n g t h - 1 ) = = v S C o n s o n a n t E [ b ] ) { t w = t w . s u b s t r ( 0 , t w . l e n g t h - 1 ) ; b r e a k }  
 	 i f ( t w )   {  
 	 	 f o r ( a = 0 ; a < v D C o n s o n a n t . l e n g t h ; a + + )   {  
 	 	 	 f o r ( b = 0 ; b < t w . l e n g t h ; b + + )   {   i f ( t w . s u b s t r ( b , v D C o n s o n a n t [ a ] . l e n g t h ) = = v D C o n s o n a n t [ a ] )   r e t u r n   t r u e   }  
 	 	 }  
 	 	 f o r ( a = 0 ; a < v S C o n s o n a n t . l e n g t h ; a + + )   {   i f ( t w . i n d e x O f ( v S C o n s o n a n t [ a ] ) > = 0 )   r e t u r n   t r u e   }  
 	 }  
 	 t e s t = t w . s u b s t r ( 0 , 1 )  
 	 i f ( ( t = = 3 ) & & ( ( t e s t = = " A " ) | | ( t e s t = = " O " ) | | ( t e s t = = " U " ) | | ( t e s t = = " Y " ) ) )   r e t u r n   t r u e  
 	 i f ( ( t = = 5 ) & & ( ( t e s t = = " E " ) | | ( t e s t = = " I " ) | | ( t e s t = = " Y " ) ) )   r e t u r n   t r u e  
 	 u w 2 = u n V 2 ( t w )  
 	 i f ( u w 2 = = n o t V 2 )   r e t u r n   t r u e  
 	 i f ( t w ! = t w E )   f o r ( z = 0 ; z < n o E . l e n g t h ; z + + )   i f ( u w 2 = = n o E [ z ] )   r e t u r n   t r u e  
 	 i f ( ( t w ! = u w ) & & ( u w 2 = = n o B E ) )   r e t u r n   t r u e  
 	 i f ( u k ! = m o c )   f o r ( z = 0 ; z < o M o c . l e n g t h ; z + + )   i f ( t w = = o M o c [ z ] )   r e t u r n   t r u e  
 	 i f ( ( u w 2 . i n d e x O f ( ' U Y E ' ) > 0 ) & & ( u k = = ' E ' ) )   c h e c k = f a l s e  
 	 i f ( ( t h e m . i n d e x O f ( u k ) > = 0 ) & & ( c h e c k ) )   {  
 	 	 f o r ( a = 0 ; a < n o A O E W . l e n g t h ; a + + )   i f ( u w 2 . i n d e x O f ( n o A O E W [ a ] ) > = 0 )   r e t u r n   t r u e  
 	 	 i f ( u k ! = t r a n g )   i f ( u w 2 = = n o A O E )   r e t u r n   t r u e  
 	 	 i f ( ( u k = = t r a n g ) & & ( t r a n g ! = ' W ' ) )   i f ( u w 2 = = n o T )   r e t u r n   t r u e  
 	 	 i f ( u k = = m o c )   f o r ( a = 0 ; a < n o M . l e n g t h ; a + + )   i f ( u w 2 = = n o M [ a ] )   r e t u r n   t r u e  
 	 	 i f ( ( u k = = m o c ) | | ( u k = = t r a n g ) )   f o r ( a = 0 ; a < n o M T . l e n g t h ; a + + )   i f ( u w 2 = = n o M T [ a ] )   r e t u r n   t r u e  
 	 }  
 	 t w 5 = t w  
 	 i f ( ( u w 2 . c h a r C o d e A t ( 0 ) = = 2 7 2 ) | | ( u w 2 . c h a r C o d e A t ( 0 ) = = 2 7 3 ) )   {   i f ( u w 2 . l e n g t h > 4 )   r e t u r n   t r u e   }  
 	 e l s e   i f ( u w 2 . l e n g t h > 3 )   r e t u r n   t r u e  
 	 r e t u r n   f a l s e  
 }  
 f u n c t i o n   D A W E O F ( c c , k )   {  
 	 v a r   r e t = n e w   A r r a y ( ) , k A = n e w   A r r a y ( A , m o c , t r a n g , E , O ) , z , a ; r e t [ 0 ] = g  
 	 v a r   c c A = n e w   A r r a y ( a A , m o c A , t r a n g A , e A , o A ) , c c r A = n e w   A r r a y ( a r A , m o c r A , a r A , e r A , o r A )  
 	 f o r ( a = 0 ; a < k A . l e n g t h ; a + + )   i f ( k = = k A [ a ] )   f o r ( z = 0 ; z < c c A [ a ] . l e n g t h ; z + + )   i f ( c c = = c c A [ a ] [ z ] )   r e t [ 1 ] = c c r A [ a ] [ z ]  
 	 i f ( r e t [ 1 ] )   r e t u r n   r e t  
 	 e l s e   r e t u r n   f a l s e  
 }  
 f u n c t i o n   f i n d C ( w , k , s f )   {  
 	 i f ( ( ( m e t h o d = = 3 ) | | ( m e t h o d = = 4 ) ) & & ( w . s u b s t r ( w . l e n g t h - 1 , 1 ) = = " \ \ " ) )   r e t u r n   n e w   A r r a y ( 1 , k . c h a r C o d e A t ( 0 ) )  
 	 v a r   s t r = " " , r e s , c c = " " , p c = " " , t E = " " , v o w A = n e w   A r r a y ( ) , s = " Â Ê Ô  ¯ê â ¡ô °" , c = 0 , d n = f a l s e , u w = u p ( w ) , t v  
 	 v a r   D A W E O F A = a A . j o i n ( ) + e A . j o i n ( ) + m o c A . j o i n ( ) + t r a n g A . j o i n ( ) + o A . j o i n ( ) + e n g l i s h ; D A W E O F A = u p ( D A W E O F A )  
 	 f o r ( g = 0 ; g < s f . l e n g t h ; g + + )   {  
 	 	 i f ( n a n ( s f [ g ] ) )   s t r + = s f [ g ]  
 	 	 e l s e   s t r + = f c c ( s f [ g ] )  
 	 }  
 	 v a r   u k = u p ( k ) , i = w . l e n g t h , u n i _ a r r a y = r e p S i g n ( k ) , w 2 = u p ( u n V 2 ( u n V ( w ) ) ) , d o n t = " ¯A , ¯U " . s p l i t ( ' , ' )  
 	 i f   ( D A W E O . i n d e x O f ( u k ) > = 0 )   {  
 	 	 i f ( u k = = m o c )   {  
 	 	 	 i f ( ( w 2 . i n d e x O f ( " U U " ) > = 0 ) & & ( t w 5 ! = d o n t [ 1 ] ) )   {  
 	 	 	 	 i f ( w 2 . i n d e x O f ( " U U " ) = = ( w . l e n g t h - 2 ) )   r e s = 2  
 	 	 	 	 e l s e   r e t u r n   f a l s e  
 	 	 	 }   e l s e   i f ( w 2 . i n d e x O f ( " U O U " ) > = 0 )   {  
 	 	 	 	 i f ( w 2 . i n d e x O f ( " U O U " ) = = ( w . l e n g t h - 3 ) )   r e s = 2  
 	 	 	 	 e l s e   r e t u r n   f a l s e  
 	 	 	 }  
 	 	 }  
 	 	 i f ( ! r e s )   {  
 	 	 	 f o r ( g = 1 ; g < = w . l e n g t h ; g + + )   {  
 	 	 	 	 c c = w . s u b s t r ( w . l e n g t h - g , 1 )  
 	 	 	 	 p c = u p ( w . s u b s t r ( w . l e n g t h - g - 1 , 1 ) )  
 	 	 	 	 u c = u p ( c c )  
 	 	 	 	 f o r ( h = 0 ; h < d o n t . l e n g t h ; h + + )   i f ( ( t w 5 = = d o n t [ h ] ) & & ( t w 5 = = u n V ( p c + u c ) ) )   d n = t r u e  
 	 	 	 	 i f ( d n )   {   d n = f a l s e ;   c o n t i n u e   }  
 	 	 	 	 i f ( s t r . i n d e x O f ( u c ) > = 0 )   {  
 	 	 	 	 	 i f ( ( ( u k = = m o c ) & & ( u n V ( u c ) = = " U " ) & & ( u p ( u n V ( w . s u b s t r ( w . l e n g t h - g + 1 , 1 ) ) ) = = " A " ) ) | | ( ( u k = = t r a n g ) & & ( u n V ( u c ) = = ' A ' ) & & ( u n V ( p c ) = = ' U ' ) ) )   {  
 	 	 	 	 	 	 i f ( u n V ( u c ) = = " U " )   t v = 1  
 	 	 	 	 	 	 e l s e   t v = 2  
 	 	 	 	 	 	 c c c = u p ( w . s u b s t r ( w . l e n g t h - g - t v , 1 ) )  
 	 	 	 	 	 	 i f ( c c c ! = " Q " )   r e s = g + t v - 1  
 	 	 	 	 	 	 e l s e   i f ( u k = = t r a n g )   r e s = g  
 	 	 	 	 	 	 e l s e   i f ( m o c ! = t r a n g )   r e t u r n   f a l s e  
 	 	 	 	 	 }   e l s e   r e s = g  
 	 	 	 	 	 i f ( ( ! w h i t ) | | ( u w . i n d e x O f ( " ¯" ) < 0 ) | | ( u w . i n d e x O f ( " W " ) < 0 ) )   b r e a k  
 	 	 	 	 }   e l s e   i f ( D A W E O F A . i n d e x O f ( u c ) > = 0 )   {  
 	 	 	 	 	 i f ( u k = = D )   {  
 	 	 	 	 	 	 i f ( c c = = " " )   r e s = n e w   A r r a y ( g , ' d ' )  
 	 	 	 	 	 	 e l s e   i f ( c c = = " " )   r e s = n e w   A r r a y ( g , ' D ' )  
 	 	 	 	 	 }   e l s e   r e s = D A W E O F ( c c , u k )  
 	 	 	 	 	 i f ( r e s )   b r e a k  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 	 i f ( ( u k ! = Z ) & & ( D A W E O . i n d e x O f ( u k ) < 0 ) )   {   v a r   t E C = r e t K C ( u k ) ;   f o r   ( g = 0 ; g < t E C . l e n g t h ; g + + )   t E + = f c c ( t E C [ g ] )   }  
 	 f o r ( g = 1 ; g < = w . l e n g t h ; g + + )   {  
 	 	 i f ( D A W E O . i n d e x O f ( u k ) < 0 )   {  
 	 	 	 c c = u p ( w . s u b s t r ( w . l e n g t h - g , 1 ) )  
 	 	 	 p c = u p ( w . s u b s t r ( w . l e n g t h - g - 1 , 1 ) )  
 	 	 	 i f ( s t r . i n d e x O f ( c c ) > = 0 )   {  
 	 	 	 	 i f ( c c = = ' U ' )   {  
 	 	 	 	 	 i f ( p c ! = ' Q ' )   {   c + + ; v o w A [ v o w A . l e n g t h ] = g   }  
 	 	 	 	 }   e l s e   i f ( c c = = ' I ' )   {  
 	 	 	 	 	 i f ( ( p c ! = ' G ' ) | | ( c < = 0 ) )   {   c + + ; v o w A [ v o w A . l e n g t h ] = g   }  
 	 	 	 	 }   e l s e   {   c + + ; v o w A [ v o w A . l e n g t h ] = g   }  
 	 	 	 }   e l s e   i f ( u k ! = Z )   {  
 	 	 	 	 f o r ( h = 0 ; h < u n i _ a r r a y . l e n g t h ; h + + )   i f ( u n i _ a r r a y [ h ] = = w . c h a r C o d e A t ( w . l e n g t h - g ) )   {  
 	 	 	 	 	 i f ( s p e l l e r r ( w , k ) )   r e t u r n   f a l s e  
 	 	 	 	 	 r e t u r n   n e w   A r r a y ( g , t E C [ h % 2 4 ] )  
 	 	 	 	 }  
 	 	 	 	 f o r ( h = 0 ; h < t E C . l e n g t h ; h + + )   i f ( t E C [ h ] = = w . c h a r C o d e A t ( w . l e n g t h - g ) )   r e t u r n   n e w   A r r a y ( g , f c c ( s k e y [ h ] ) )  
 	 	 	 }  
 	 	 }  
 	 }  
 	 i f ( ( u k ! = Z ) & & ( t y p e o f ( r e s ) ! = ' o b j e c t ' ) )   i f ( s p e l l e r r ( w , k ) )   r e t u r n   f a l s e  
 	 i f ( D A W E O . i n d e x O f ( u k ) < 0 )   {  
 	 	 f o r ( g = 1 ; g < = w . l e n g t h ; g + + )   {  
 	 	 	 i f ( ( u k ! = Z ) & & ( s . i n d e x O f ( w . s u b s t r ( w . l e n g t h - g , 1 ) ) > = 0 ) )   r e t u r n   g  
 	 	 	 e l s e   i f ( t E . i n d e x O f ( w . s u b s t r ( w . l e n g t h - g , 1 ) ) > = 0 )   {  
 	 	 	 	 f o r ( h = 0 ; h < t E C . l e n g t h ; h + + )   {  
 	 	 	 	 	 i f ( w . s u b s t r ( w . l e n g t h - g , 1 ) . c h a r C o d e A t ( 0 ) = = t E C [ h ] )   r e t u r n   n e w   A r r a y ( g , f c c ( s k e y [ h ] ) )  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 	 i f ( r e s )   r e t u r n   r e s  
 	 i f ( ( c = = 1 ) | | ( u k = = Z ) )   r e t u r n   v o w A [ 0 ]  
 	 e l s e   i f ( c = = 2 )   {  
 	 	 v a r   v = 2  
 	 	 i f ( w . s u b s t r ( w . l e n g t h - 1 ) = = "   " )   v = 3  
 	 	 v a r   t t t = u p ( w . s u b s t r ( w . l e n g t h - v , 2 ) )  
 	 	 i f ( ( d a u C u = = 0 ) & & ( ( t t t = = " U Y " ) | | ( t t t = = " O A " ) | | ( t t t = = " O E " ) ) )   r e t u r n   v o w A [ 0 ]  
 	 	 v a r   c 2 = 0 , f d c o n s o n a n t , s c = " B C D " + f c c ( 2 7 2 ) + " G H K L M N P Q R S T V X " , d c = " C H , G I , K H , N G H , G H , N G , N H , P H , Q U , T H , T R " . s p l i t ( ' , ' )  
 	 	 f o r ( h = 1 ; h < = w . l e n g t h ; h + + )   {  
 	 	 	 f d c o n s o n a n t = f a l s e  
 	 	 	 f o r ( g = 0 ; g < d c . l e n g t h ; g + + )   {  
 	 	 	 	 i f ( u p ( w . s u b s t r ( w . l e n g t h - h - d c [ g ] . l e n g t h + 1 , d c [ g ] . l e n g t h ) ) . i n d e x O f ( d c [ g ] ) > = 0 )   {  
 	 	 	 	 	 c 2 + + ; f d c o n s o n a n t = t r u e  
 	 	 	 	 	 i f ( d c [ g ] ! = ' N G H ' )   h + +  
 	 	 	 	 	 e l s e   h + = 2  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 i f ( ! f d c o n s o n a n t )   {  
 	 	 	 	 i f ( s c . i n d e x O f ( u p ( w . s u b s t r ( w . l e n g t h - h , 1 ) ) ) > = 0 )   c 2 + +  
 	 	 	 	 e l s e   b r e a k  
 	 	 	 }  
 	 	 }  
 	 	 i f ( ( c 2 = = 1 ) | | ( c 2 = = 2 ) )   r e t u r n   v o w A [ 0 ]  
 	 	 e l s e   r e t u r n   v o w A [ 1 ]  
 	 }   e l s e   i f ( c = = 3 )   r e t u r n   v o w A [ 1 ]  
 	 e l s e   r e t u r n   f a l s e  
 }  
 f u n c t i o n   u n V ( w )   {  
 	 v a r   u = r e p S i g n ( n u l l ) , b , a  
 	 f o r ( a = 1 ; a < = w . l e n g t h ; a + + )   {  
 	 	 f o r ( b = 0 ; b < u . l e n g t h ; b + + )   {  
 	 	 	 i f ( u [ b ] = = w . c h a r C o d e A t ( w . l e n g t h - a ) )   {  
 	 	 	 	 w = w . s u b s t r ( 0 , w . l e n g t h - a ) + f c c ( s k e y [ b % 2 4 ] ) + w . s u b s t r ( w . l e n g t h - a + 1 )  
 	 	 	 }  
 	 	 }  
 	 }  
 	 r e t u r n   w  
 }  
 f u n c t i o n   u n V 2 ( w )   {  
 	 v a r   a , b  
 	 f o r ( a = 1 ; a < = w . l e n g t h ; a + + )   {  
 	 	 f o r ( b = 0 ; b < s k e y . l e n g t h ; b + + )   {  
 	 	 	 i f ( s k e y [ b ] = = w . c h a r C o d e A t ( w . l e n g t h - a ) )   w = w . s u b s t r ( 0 , w . l e n g t h - a ) + s k e y 2 [ b ] + w . s u b s t r ( w . l e n g t h - a + 1 )  
 	 	 }  
 	 }  
 	 r e t u r n   w  
 }  
 f u n c t i o n   r e p S i g n ( k )   {  
 	 v a r   t = n e w   A r r a y ( ) , u = n e w   A r r a y ( ) , a , b  
 	 f o r ( a = 0 ; a < 5 ; a + + )   {  
 	 	 i f ( ( k = = n u l l ) | | ( S F J R X . s u b s t r ( a , 1 ) ! = u p ( k ) ) )   {  
 	 	 	 t = r e t K C ( S F J R X . s u b s t r ( a , 1 ) )  
 	 	 	 f o r ( b = 0 ; b < t . l e n g t h ; b + + )   u [ u . l e n g t h ] = t [ b ]  
 	 	 }  
 	 }  
 	 r e t u r n   u  
 }  
 f u n c t i o n   s r ( w , k , i )   {  
 	 v a r   s f = g e t S F ( )  
 	 p o s = f i n d C ( w , k , s f )  
 	 i f ( p o s )   {  
 	 	 i f ( p o s [ 1 ] )   {  
 	 	 	 i f ( ! i s _ i e )   r e p l a c e C h a r ( o c , i - p o s [ 0 ] , p o s [ 1 ] )  
 	 	 	 e l s e   r e t u r n   i e _ r e p l a c e C h a r ( w , p o s [ 0 ] , p o s [ 1 ] )  
 	 	 }   e l s e   {  
 	 	 	 v a r   c = r e t U n i ( w , k , p o s )  
 	 	 	 i f   ( ! i s _ i e )   r e p l a c e C h a r ( o c , i - p o s , c )  
 	 	 	 e l s e   r e t u r n   i e _ r e p l a c e C h a r ( w , p o s , c )  
 	 	 }  
 	 }  
 	 r e t u r n   f a l s e  
 }  
 f u n c t i o n   r e t U n i ( w , k , p o s )   {  
 	 v a r   u = r e t K C ( u p ( k ) ) , u C , l C , c = w . c h a r C o d e A t ( w . l e n g t h - p o s ) , a  
 	 f o r ( a = 0 ; a < s k e y . l e n g t h ; a + + )   i f ( s k e y [ a ] = = c )   {  
 	 	 i f ( a < 1 2 )   {   l C = a ; u C = a + 1 2   }  
 	 	 e l s e   {   l C = a - 1 2 ; u C = a   }  
 	 	 t = f c c ( c ) ; i f ( t ! = u p ( t ) )   r e t u r n   u [ l C ]  
 	 	 r e t u r n   u [ u C ]  
 	 }  
 }  
 f u n c t i o n   r e p l a c e C h a r ( o , p o s , c )   {  
 	 v a r   b b = f a l s e ;   i f ( ! n a n ( c ) )   {   v a r   r e p l a c e B y = f c c ( c ) , w f i x = u p ( u n V ( f c c ( c ) ) ) ;   c h a n g e d = t r u e   }  
 	 e l s e   {   v a r   r e p l a c e B y = c ;   i f ( ( u p ( c ) = = " O " ) & & ( w h i t ) )   b b = t r u e   }  
 	 i f ( ! o . d a t a )   {  
 	 	 v a r   s a v e P o s = o . s e l e c t i o n S t a r t , s s t = o . s c r o l l T o p  
 	 	 i f   ( ( u p ( o . v a l u e . s u b s t r ( p o s - 1 , 1 ) ) = = ' U ' ) & & ( p o s < s a v e P o s - 1 ) & & ( u p ( o . v a l u e . s u b s t r ( p o s - 2 , 1 ) ) ! = ' Q ' ) )   {  
 	 	 	 i f ( ( w f i x = = "  " ) | | ( b b ) )  
 	 	 	 {  
 	 	 	 	 i f   ( o . v a l u e . s u b s t r ( p o s - 1 , 1 ) = = ' u ' )   v a r   r = f c c ( 4 3 2 )  
 	 	 	 	 e l s e   v a r   r = f c c ( 4 3 1 )  
 	 	 	 }  
 	 	 	 i f ( b b )   {  
 	 	 	 	 c h a n g e d = t r u e ;   i f ( c = = " o " )   r e p l a c e B y = " ¡"  
 	 	 	 	 e l s e   r e p l a c e B y = "  "  
 	 	 	 }  
 	 	 }  
 	 	 o . v a l u e = o . v a l u e . s u b s t r ( 0 , p o s ) + r e p l a c e B y + o . v a l u e . s u b s t r ( p o s + 1 )  
 	 	 i f ( r )   o . v a l u e = o . v a l u e . s u b s t r ( 0 , p o s - 1 ) + r + o . v a l u e . s u b s t r ( p o s )  
 	 	 o . s e t S e l e c t i o n R a n g e ( s a v e P o s , s a v e P o s ) ; o . s c r o l l T o p = s s t  
 	 }   e l s e   {  
 	 	 i f   ( ( u p ( o . d a t a . s u b s t r ( p o s - 1 , 1 ) ) = = ' U ' ) & & ( p o s < o . p o s - 1 ) )   {  
 	 	 	 i f ( ( w f i x = = "  " ) | | ( b b ) )  
 	 	 	 {  
 	 	 	 	 i f   ( o . d a t a . s u b s t r ( p o s - 1 , 1 ) = = ' u ' )   v a r   r = f c c ( 4 3 2 )  
 	 	 	 	 e l s e   v a r   r = f c c ( 4 3 1 )  
 	 	 	 }  
 	 	 	 i f ( b b )   {  
 	 	 	 	 c h a n g e d = t r u e ;   i f ( c = = " o " )   r e p l a c e B y = " ¡"  
 	 	 	 	 e l s e   r e p l a c e B y = "  "  
 	 	 	 }  
 	 	 }  
 	 	 o . d e l e t e D a t a ( p o s , 1 ) ; o . i n s e r t D a t a ( p o s , r e p l a c e B y )  
 	 	 i f ( r )   {   o . d e l e t e D a t a ( p o s - 1 , 1 ) ; o . i n s e r t D a t a ( p o s - 1 , r )   }  
 	 }  
 	 i f ( w h i t )   w h i t = f a l s e  
 }  
 f u n c t i o n   r e t K C ( k )   {  
 	 i f ( k = = S )   r e t u r n   n e w   A r r a y ( 2 2 5 , 7 8 4 5 , 7 8 5 5 , 2 3 3 , 7 8 7 1 , 2 3 7 , 2 4 3 , 7 8 8 9 , 7 8 9 9 , 2 5 0 , 7 9 1 3 , 2 5 3 , 1 9 3 , 7 8 4 4 , 7 8 5 4 , 2 0 1 , 7 8 7 0 , 2 0 5 , 2 1 1 , 7 8 8 8 , 7 8 9 8 , 2 1 8 , 7 9 1 2 , 2 2 1 )  
 	 i f ( k = = F )   r e t u r n   n e w   A r r a y ( 2 2 4 , 7 8 4 7 , 7 8 5 7 , 2 3 2 , 7 8 7 3 , 2 3 6 , 2 4 2 , 7 8 9 1 , 7 9 0 1 , 2 4 9 , 7 9 1 5 , 7 9 2 3 , 1 9 2 , 7 8 4 6 , 7 8 5 6 , 2 0 0 , 7 8 7 2 , 2 0 4 , 2 1 0 , 7 8 9 0 , 7 9 0 0 , 2 1 7 , 7 9 1 4 , 7 9 2 2 )  
 	 i f ( k = = J )   r e t u r n   n e w   A r r a y ( 7 8 4 1 , 7 8 5 3 , 7 8 6 3 , 7 8 6 5 , 7 8 7 9 , 7 8 8 3 , 7 8 8 5 , 7 8 9 7 , 7 9 0 7 , 7 9 0 9 , 7 9 2 1 , 7 9 2 5 , 7 8 4 0 , 7 8 5 2 , 7 8 6 2 , 7 8 6 4 , 7 8 7 8 , 7 8 8 2 , 7 8 8 4 , 7 8 9 6 , 7 9 0 6 , 7 9 0 8 , 7 9 2 0 , 7 9 2 4 )  
 	 i f ( k = = R )   r e t u r n   n e w   A r r a y ( 7 8 4 3 , 7 8 4 9 , 7 8 5 9 , 7 8 6 7 , 7 8 7 5 , 7 8 8 1 , 7 8 8 7 , 7 8 9 3 , 7 9 0 3 , 7 9 1 1 , 7 9 1 7 , 7 9 2 7 , 7 8 4 2 , 7 8 4 8 , 7 8 5 8 , 7 8 6 6 , 7 8 7 4 , 7 8 8 0 , 7 8 8 6 , 7 8 9 2 , 7 9 0 2 , 7 9 1 0 , 7 9 1 6 , 7 9 2 6 )  
 	 i f ( k = = X )   r e t u r n   n e w   A r r a y ( 2 2 7 , 7 8 5 1 , 7 8 6 1 , 7 8 6 9 , 7 8 7 7 , 2 9 7 , 2 4 5 , 7 8 9 5 , 7 9 0 5 , 3 6 1 , 7 9 1 9 , 7 9 2 9 , 1 9 5 , 7 8 5 0 , 7 8 6 0 , 7 8 6 8 , 7 8 7 6 , 2 9 6 , 2 1 3 , 7 8 9 4 , 7 9 0 4 , 3 6 0 , 7 9 1 8 , 7 9 2 8 )  
 }  
 f u n c t i o n   g e t E L ( 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 )   }  
 f u n c t i o n   g e t S F ( )   {   v a r   s f = n e w   A r r a y ( ) , x ;   f o r ( x = 0 ; x < s k e y . l e n g t h ; x + + )   s f [ s f . l e n g t h ] = f c c ( s k e y [ x ] ) ;   r e t u r n   s f   }  
 f u n c t i o n   s t a t u s M e s s a g e ( )   {  
 	 v a r   s t r = ' K i Ãu   g õ :   '  
 	 i f ( o n _ o f f = = 0 )   s t r + = ' T ¯t '  
 	 e l s e   i f ( m e t h o d = = 1 )   s t r + = ' T E L E X '  
 	 e l s e   i f ( m e t h o d = = 2 )   s t r + = ' V N I '  
 	 e l s e   i f ( m e t h o d = = 3 )   s t r + = ' V I Q R '  
 	 e l s e   i f ( m e t h o d = = 4 )   s t r + = ' V I Q R * '  
 	 e l s e   i f ( m e t h o d = = 0 )   s t r + = ' T ñ  Ùn g '  
 	 i f ( i s K H T M L )   s t r + = "   [ A l t - F 9 ] "  
 	 e l s e   s t r + = "   [ F 9 ] "  
 	 s t r + = "   |   C h í n h   t £:   "  
 	 s t r + = ( d o c k s p e l l = = 0 ) ? " T ¯t " : " B ­t "  
 	 i f ( i s K H T M L )   s t r + = "   [ A l t - F 8 ] "  
 	 e l s e   s t r + = "   [ F 8 ] "  
 	 s t r + = "   |   B Ï  d ¥u :   "  
 	 s t r + = ( d a u C u = = 1 ) ? " C i" : " M Ûi "  
 	 i f ( i s K H T M L )   s t r + = "   [ A l t - F 7 ] "  
 	 e l s e   s t r + = "   [ F 7 ] "  
 	 s t r + = "   |   B ­t / T ¯t   [ F 1 2 ]   -   A n h T r a n g . O r g "  
 	 w i n d o w . s t a t u s = s t r  
 }  
 f u n c t i o n   u p d a t e I n f o ( )   {   s e t C o o k i e ( ) ;   i f ( s u p p o r t )   s t a t u s M e s s a g e ( )   }  
 f u n c t i o n   s e t M e t h o d ( m )   {  
 	 i f ( m = = - 1 )   {   o n _ o f f = 0 ; i f ( g e t E L ( r a d i o I D [ 5 ] ) )   g e t E L ( r a d i o I D [ 5 ] ) . c h e c k e d = t r u e   }  
 	 e l s e   {   o n _ o f f = 1 ; m e t h o d = m ; i f ( g e t E L ( r a d i o I D [ m ] ) )   g e t E L ( r a d i o I D [ m ] ) . c h e c k e d = t r u e   }  
 	 s e t S p e l l ( d o c k s p e l l ) ; s e t D a u C u ( d a u C u ) ; u p d a t e I n f o ( )  
 }  
 f u n c t i o n   s e t D a u C u ( b o x )   {  
 	 i f ( t y p e o f ( b o x ) = = " n u m b e r " )   {  
 	 	 d a u C u = b o x ; i f ( g e t E L ( r a d i o I D [ 7 ] ) )   g e t E L ( r a d i o I D [ 7 ] ) . c h e c k e d = b o x  
 	 }   e l s e   d a u C u = ( b o x . c h e c k e d ) ? 1 : 0  
 	 u p d a t e I n f o ( )  
 }  
 f u n c t i o n   s e t S p e l l ( b o x )   {  
 	 i f ( t y p e o f ( b o x ) = = " n u m b e r " )   {    
 	 	 s p e l l e r r = ( b o x = = 1 ) ? c k s p e l l : n o s p e l l  
 	 	 i f ( g e t E L ( r a d i o I D [ 6 ] ) )   g e t E L ( r a d i o I D [ 6 ] ) . c h e c k e d = b o x  
 	 }  
 	 e l s e   {  
 	 	 i f ( b o x . c h e c k e d )   {   s p e l l e r r = c k s p e l l ; d o c k s p e l l = 1   }  
 	 	 e l s e   {   s p e l l e r r = n o s p e l l ; d o c k s p e l l = 0   }  
 	 }  
 	 u p d a t e I n f o ( )  
 }  
 f u n c t i o n   o n K e y D o w n ( e )   {  
 	 i f   ( e = = ' i f r a m e ' )   {   f r a m e = f i n d F ( ) ; v a r   k e y = f r a m e . e v e n t . k e y C o d e   }  
 	 e l s e   v a r   k e y = ( ! i s _ i e ) ? e . w h i c h : w i n d o w . e v e n t . k e y C o d e  
 	 i f ( ( k e y = = 1 2 0 ) | | ( k e y = = 1 2 3 ) | | ( k e y = = 1 1 9 ) | | ( k e y = = 1 1 8 ) )   {  
 	 	 i f ( k e y = = 1 2 0 )   {   o n _ o f f = 1 ; s e t M e t h o d ( ( ( m e t h o d = = 4 ) ? 0 : + + m e t h o d ) )   }  
 	 	 e l s e   i f ( k e y = = 1 1 8 )   {   s e t D a u C u ( ( ( d a u C u = = 1 ) ? 0 : 1 ) )   }  
 	 	 e l s e   i f ( k e y = = 1 1 9 )   {   d o c k s p e l l = ( d o c k s p e l l = = 0 ) ? 1 : 0 ; s e t S p e l l ( d o c k s p e l l )   }  
 	 	 e l s e   i f ( k e y = = 1 2 3 )   {  
 	 	 	 o n _ o f f = ( o n _ o f f = = 0 ) ? 1 : 0  
 	 	 	 i f ( o n _ o f f = = 0 )   s e t M e t h o d ( - 1 )  
 	 	 	 e l s e   s e t M e t h o d ( m e t h o d )  
 	 	 }  
 	 	 u p d a t e I n f o ( )  
 	 }  
 }  
 f u n c t i o n   i f I n i t ( w )   {  
 	 v a r   s e l = w . g e t S e l e c t i o n ( )  
 	 r a n g e = s e l ? s e l . g e t R a n g e A t ( 0 ) : d o c u m e n t . c r e a t e R a n g e ( )  
 }  
 f u n c t i o n   i f M o z ( e )   {  
 	 v a r   c o d e = e . w h i c h , c w i = e . t a r g e t . p a r e n t N o d e . w i  
 	 i f ( t y p e o f ( c w i ) = = " u n d e f i n e d " )   c w i = e . t a r g e t . p a r e n t N o d e . p a r e n t N o d e . w i  
 	 i f ( ( e . c t r l K e y ) | | ( ( e . a l t K e y ) & & ( c o d e ! = 9 2 ) & & ( c o d e ! = 1 2 6 ) ) )   r e t u r n ; i f I n i t ( c w i )  
 	 v a r   n o d e = r a n g e . e n d C o n t a i n e r , n e w P o s ; s k = f c c ( c o d e ) ; s a v e S t r = " "  
 	 i f ( c h e c k C o d e ( c o d e ) | | ( ! r a n g e . s t a r t O f f s e t ) | | ( t y p e o f ( n o d e . d a t a ) = = ' u n d e f i n e d ' ) )   r e t u r n ; n o d e . s e l = f a l s e  
 	 i f ( n o d e . d a t a )   {  
 	 	 s a v e S t r = n o d e . d a t a . s u b s t r ( r a n g e . e n d O f f s e t )  
 	 	 i f ( r a n g e . s t a r t O f f s e t ! = r a n g e . e n d O f f s e t )   n o d e . s e l = t r u e  
 	 	 n o d e . d e l e t e D a t a ( r a n g e . s t a r t O f f s e t , n o d e . d a t a . l e n g t h )  
 	 }  
 	 r a n g e . s e t E n d ( n o d e , r a n g e . e n d O f f s e t )  
 	 r a n g e . s e t S t a r t ( n o d e , 0 )  
 	 i f ( ! n o d e . d a t a )   r e t u r n  
 	 n o d e . v a l u e = n o d e . d a t a ;   n o d e . p o s = n o d e . d a t a . l e n g t h ;   n o d e . w h i c h = c o d e  
 	 s t a r t ( n o d e , e )  
 	 n o d e . i n s e r t D a t a ( n o d e . d a t a . l e n g t h , s a v e S t r )  
 	 n e w P o s = n o d e . d a t a . l e n g t h - s a v e S t r . l e n g t h + k l  
 	 r a n g e . s e t E n d ( n o d e , n e w P o s ) ; r a n g e . s e t S t a r t ( n o d e , n e w P o s ) ; k l = 0  
 	 i f ( s p e c i a l C h a n g e )   {   s p e c i a l C h a n g e = f a l s e ;   c h a n g e d = f a l s e ;   n o d e . d e l e t e D a t a ( n o d e . p o s - 1 , 1 )   }  
 	 i f ( c h a n g e d )   {   c h a n g e d = f a l s e ;   e . p r e v e n t D e f a u l t ( )   }  
 }  
 f u n c t i o n   F K e y P r e s s ( )   {  
 	 v a r   o b j = f i n d F ( )  
 	 s k = f c c ( o b j . e v e n t . k e y C o d e )  
 	 i f ( c h e c k C o d e ( o b j . e v e n t . k e y C o d e ) | | ( ( o b j . e v e n t . c t r l K e y ) & & ( o b j . e v e n t . k e y C o d e ! = 9 2 ) & & ( o b j . e v e n t . k e y C o d e ! = 1 2 6 ) ) )   r e t u r n  
 	 s t a r t ( o b j , f c c ( o b j . e v e n t . k e y C o d e ) )  
 	 i f   ( c h a n g e d )   {   c h a n g e d = f a l s e ;   r e t u r n   f a l s e   }  
 }  
 f u n c t i o n   c h e c k C o d e ( c o d e )   {   i f ( ( ( o n _ o f f = = 0 ) | | ( ( c o d e < 4 5 ) & & ( c o d e ! = 4 2 ) & & ( c o d e ! = 3 2 ) & & ( c o d e ! = 3 9 ) & & ( c o d e ! = 4 0 ) & & ( c o d e ! = 4 3 ) ) | | ( c o d e = = 1 4 5 ) | | ( c o d e = = 2 5 5 ) ) )   r e t u r n   t r u e ;   r e t u r n   f a l s e   }  
 f u n c t i o n   f c c ( x )   {   r e t u r n   S t r i n g . f r o m C h a r C o d e ( x )   }  
 i f ( u s e C o o k i e = = 1 )   {   s e t C o o k i e = d o S e t C o o k i e ;   g e t C o o k i e = d o G e t C o o k i e   }  
 e l s e   {   s e t C o o k i e = n o C o o k i e ;   g e t C o o k i e = n o C o o k i e   }  
 f u n c t i o n   n o C o o k i e ( )   { }  
 f u n c t i o n   d o S e t C o o k i e ( )   {  
 	 v a r   e x p = n e w   D a t e ( 1 1 2 4 5 7 1 1 1 5 6 4 8 0 ) . t o G M T S t r i n g ( ) , e n d = ' ; e x p i r e s = ' + e x p + ' ; p a t h = / '  
 	 d o c u m e n t . c o o k i e = ' A V I M _ o n _ o f f = ' + o n _ o f f + e n d  
 	 d o c u m e n t . c o o k i e = ' A V I M _ m e t h o d = ' + m e t h o d + e n d  
 	 d o c u m e n t . c o o k i e = ' A V I M _ c k s p e l l = ' + d o c k s p e l l + e n d  
 	 d o c u m e n t . c o o k i e = ' A V I M _ d a u c u = ' + d a u C u + e n d  
 }  
 f u n c t i o n   d o G e t C o o k i e ( )   {  
 	 v a r   c k = d o c u m e n t . c o o k i e ,   r e s = / A V I M _ m e t h o d / . t e s t ( c k )  
 	 i f ( ( ! r e s ) | | ( c k . i n d e x O f ( ' A V I M _ c k s p e l l ' ) < 0 ) )   {   s e t C o o k i e ( ) ;   r e t u r n   }  
 	 v a r   p , c k A = c k . s p l i t ( ' ; ' )  
 	 f o r ( v a r   i = 0 ; i < c k A . l e n g t h ; i + + )   {  
 	 	 p = c k A [ i ] . s p l i t ( ' = ' ) ;   p [ 0 ] = p [ 0 ] . r e p l a c e ( / ^ \ s + / g , " " ) ;   p [ 1 ] = p a r s e I n t ( p [ 1 ] )  
 	 	 i f ( p [ 0 ] = = ' A V I M _ o n _ o f f ' )   o n _ o f f = p [ 1 ]  
 	 	 e l s e   i f ( p [ 0 ] = = ' A V I M _ m e t h o d ' )   m e t h o d = p [ 1 ]  
 	 	 e l s e   i f ( p [ 0 ] = = ' A V I M _ c k s p e l l ' )   {  
 	 	 	 i f ( p [ 1 ] = = 0 )   {   d o c k s p e l l = 0 ;   s p e l l e r r = n o s p e l l   }  
 	 	 	 e l s e   {   d o c k s p e l l = 1 ;   s p e l l e r r = c k s p e l l   }  
 	 	 }   e l s e   i f ( p [ 0 ] = = ' A V I M _ d a u c u ' )   d a u C u = p a r s e I n t ( p [ 1 ] )  
 	 }  
 }  
 i f ( ! i s _ i e )   {  
 	 i f ( a g t . i n d e x O f ( " o p e r a " ) > = 0 )   {  
 	 	 o p e r a V = a g t . s p l i t ( "   " ) ; o p e r a V e r s i o n = p a r s e I n t ( o p e r a V [ o p e r a V . l e n g t h - 1 ] )  
 	 	 i f ( o p e r a V e r s i o n > = 8 )   i s _ o p e r a = t r u e  
 	 	 e l s e   {  
 	 	 	 o p e r a V = o p e r a V [ 0 ] . s p l i t ( " / " ) ; o p e r a V e r s i o n = p a r s e I n t ( o p e r a V [ 1 ] )  
 	 	 	 i f ( o p e r a V e r s i o n > = 8 )   i s _ o p e r a = t r u e  
 	 	 }  
 	 }   e l s e   i f ( a g t . i n d e x O f ( " k h t m l " ) > = 0 )   i s K H T M L = t r u e  
 	 e l s e   {  
 	 	 v e r = a g t . s u b s t r ( a g t . i n d e x O f ( " r v : " ) + 3 )  
 	 	 v e r = p a r s e F l o a t ( v e r . s u b s t r ( 0 , v e r . i n d e x O f ( "   " ) ) )  
 	 	 i f ( a g t . i n d e x O f ( " m o z i l l a " ) < 0 )   v e r = 0  
 	 }  
 }  
 f u n c t i o n   u p ( w )   {  
 	 w = w . t o U p p e r C a s e ( )  
 	 i f ( i s K H T M L )   {  
 	 	 s t r = " ê ô ¡â °¿ÑÛ¥¯éÁÓÝ§±ëÅ×á«µïÇÙã­·ñ" , r e p = " Ê Ô  Â ¯¾ÐÚ¤®èÀÒÜ¦°êÄÖàª´îÆØâ¶ð"  
 	 	 f o r ( z = 0 ; z < w . l e n g t h ; z + + )   {  
 	 	 	 i o = s t r . i n d e x O f ( w . s u b s t r ( z , 1 ) )  
 	 	 	 i f ( i o > = 0 )   w = w . s u b s t r ( 0 , z ) + r e p . s u b s t r ( i o , 1 ) + w . s u b s t r ( z + 1 )  
 	 	 }  
 	 }  
 	 r e t u r n   w  
 }  
 f u n c t i o n   f i n d I g n o r e ( e l )   {  
 	 f o r ( i = 0 ; i < v a . l e n g t h ; i + + )   i f ( ( e l . i d = = v a [ i ] ) & & ( v a [ i ] . l e n g t h > 0 ) )   r e t u r n   t r u e  
 }  
 i f ( ( i s _ i e ) | | ( v e r > = 1 . 3 ) | | ( i s _ o p e r a ) | | ( i s K H T M L ) )   {  
 	 g e t C o o k i e ( )  
 	 i f ( o n _ o f f = = 0 )   s e t M e t h o d ( - 1 )  
 	 e l s e   s e t M e t h o d ( m e t h o d )  
 	 s e t S p e l l ( d o c k s p e l l ) ; s e t D a u C u ( d a u C u ) ; s t a t u s M e s s a g e ( )  
 }   e l s e   s u p p o r t = f a l s e  
 f u n c t i o n   o n K e y P r e s s ( e )   {  
 	 i f ( ! s u p p o r t )   r e t u r n  
 	 i f ( ! i s _ i e )   {   v a r   e l = e . t a r g e t , c o d e = e . w h i c h ;   i f ( e . c t r l K e y )   r e t u r n ;   i f ( ( e . a l t K e y ) & & ( c o d e ! = 9 2 ) & & ( c o d e ! = 1 2 6 ) )   r e t u r n   }  
 	 e l s e   {   v a r   e l = w i n d o w . e v e n t . s r c E l e m e n t , c o d e = w i n d o w . e v e n t . k e y C o d e ;   i f ( ( e v e n t . c t r l K e y ) & & ( c o d e ! = 9 2 ) & & ( c o d e ! = 1 2 6 ) )   r e t u r n   }  
 	 i f ( ( ( e l . t y p e ! = ' t e x t a r e a ' ) & & ( e l . t y p e ! = ' t e x t ' ) ) | | c h e c k C o d e ( c o d e ) )   r e t u r n  
 	 s k = f c c ( c o d e ) ;   i f   ( f i n d I g n o r e ( e l ) )   r e t u r n  
 	 i f ( ! i s _ i e )   s t a r t ( e l , e )  
 	 e l s e   s t a r t ( e l , s k )  
 	 i f ( c h a n g e d )   {    
 	 	 c h a n g e d = f a l s e  
 	 	 i f   ( ! i s _ i e )   e . p r e v e n t D e f a u l t ( )  
 	 	 e l s e   r e t u r n   f a l s e  
 	 }  
 }  
 f u n c t i o n   a t t a c h E v t ( o b j , e v t , h a n d l e , c a p t u r e )   {  
 	 i f ( i s _ i e )   {   o b j . a t t a c h E v e n t ( " o n " + e v t , h a n d l e ) ;   o b j . a t t a c h E v e n t ( " o n " + e v t , g e t C o o k i e )   }  
 	 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 t , h a n d l e , c a p t u r e ) ;   o b j . a d d E v e n t L i s t e n e r ( e v t , g e t C o o k i e , c a p t u r e )   }  
 }  
 a t t a c h E v t ( d o c u m e n t , " k e y d o w n " , o n K e y D o w n , f a l s e )  
 a t t a c h E v t ( d o c u m e n t , " k e y p r e s s " , o n K e y P r e s s , f a l s e )  
 f u n c t i o n   f i n d F ( )   {  
 	 f o r ( g = 0 ; g < f I D . l e n g t h ; g + + )   {  
 	 	 i f ( f i n d I g n o r e ( f I D [ g ] ) )   c o n t i n u e ; f r a m e = f I D [ g ]  
 	 	 i f ( t y p e o f ( f r a m e ) ! = " u n d e f i n e d " )   {  
 	 	 	 t r y   {   i f ( ( f r a m e . c o n t e n t W i n d o w . d o c u m e n t ) & & ( f r a m e . c o n t e n t W i n d o w . e v e n t ) )   r e t u r n   f r a m e . c o n t e n t W i n d o w   }  
 	 	 	 c a t c h ( e )   {   i f ( ( f r a m e . d o c u m e n t ) & & ( f r a m e . e v e n t ) )   r e t u r n   f r a m e   }  
 	 	 }  
 	 }  
 }  
 f u n c t i o n   o n K e y D o w n I ( )   {   o n K e y D o w n ( " i f r a m e " )   }  
 f u n c t i o n   i n i t ( )   {  
 v a r   k k k = f a l s e  
 i f ( ( s u p p o r t ) & & ( ! i s K H T M L ) )   {  
 	 i f ( i s _ o p e r a )   {   i f ( o p e r a V e r s i o n < 9 )   r e t u r n   }  
 	 f o r ( g = 0 ; g < f I D . l e n g t h ; g + + )   {  
 	 	 i f ( f i n d I g n o r e ( f I D [ g ] ) )   c o n t i n u e  
 	 	 i f ( i s _ i e )   {  
 	 	 	 v a r   d o c  
 	 	 	 t r y   {  
 	 	 	 	 f r a m e = f I D [ g ] ; i f ( t y p e o f ( f r a m e ) ! = " u n d e f i n e d " )   {  
 	 	 	 	 	 i f ( f r a m e . c o n t e n t W i n d o w . d o c u m e n t )   d o c = f r a m e . c o n t e n t W i n d o w . d o c u m e n t  
 	 	 	 	 	 e l s e   i f ( f r a m e . d o c u m e n t )   d o c = f r a m e . d o c u m e n t  
 	 	 	 	 }  
 	 	 	 	 i f ( ( d o c ) & & ( ( u p ( d o c . d e s i g n M o d e ) = = " O N " ) | | ( d o c . b o d y . c o n t e n t E d i t a b l e ) ) )   {  
 	 	 	 	 	 f o r ( l = 0 ; l < a t t a c h e d . l e n g t h ; l + + )   i f ( d o c = = a t t a c h e d [ l ] )   {   k k k = t r u e ;   b r e a k   }  
 	 	 	 	 	 i f ( ! k k k )   {  
 	 	 	 	 	 	 a t t a c h e d [ a t t a c h e d . l e n g t h ] = d o c  
 	 	 	 	 	 	 a t t a c h E v t ( d o c , " k e y d o w n " , o n K e y D o w n I , f a l s e )  
 	 	 	 	 	 	 a t t a c h E v t ( d o c , " k e y p r e s s " , F K e y P r e s s , f a l s e )  
 	 	 	 	 	 }   e l s e   k k k = f a l s e  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 c a t c h ( e )   {   }  
 	 	 }   e l s e   {  
 	 	 	 v a r   i f r a m e d i t  
 	 	 	 t r y   {  
 	 	 	 	 w i = f I D [ g ] . c o n t e n t W i n d o w ; i f r a m e d i t = w i . d o c u m e n t ; i f r a m e d i t . w i = w i  
 	 	 	 	 i f ( ( i f r a m e d i t ) & & ( u p ( i f r a m e d i t . d e s i g n M o d e ) = = " O N " ) )   {  
 	 	 	 	 	 a t t a c h E v t ( i f r a m e d i t , " k e y p r e s s " , i f M o z , f a l s e )  
 	 	 	 	 	 a t t a c h E v t ( i f r a m e d i t , " k e y d o w n " , o n K e y D o w n , t r u e )  
 	 	 	 	 }  
 	 	 	 }   c a t c h ( e )   {   }  
 	 	 }  
 	 }  
 }  
 }  
 f u n c t i o n   u g l y F ( )   {   u g l y = 5 0 ; w h i l e ( u g l y < 5 0 0 0 )   { s e t T i m e o u t ( " i n i t ( ) " , u g l y ) ; u g l y + = 5 0 }   }  
 u g l y F ( ) ; a t t a c h E v t ( d o c u m e n t , " m o u s e d o w n " , u g l y F , f a l s e ) 