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