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