ÿþf u n c t i o n   P o r c e n t a j e V a l i d o ( p o r c e n t , m a x v a l u e ) {  
 	 / *  
 	 	 S i   m a x v a l u e = - 1   e n t o n c e s   n o   h a y   l í m i t e   e n   e l   p o r c e n t a j e .   E s t a r á   b i e n  
 	 * /  
 	 i f   ( m a x v a l u e = = - 1 )  
 	 	 r e t u r n   t r u e ;  
 	 e l s e   {  
 	 	 v a r   t m p V a l u e ;  
 	 	  
 	 	 t m p V a l u e = n e w   S t r i n g ( p o r c e n t ) ;  
 	 	 t m p V a l u e = t m p V a l u e . r e p l a c e ( / \ , / g , ' . ' ) ;  
 	 	  
 	 	 i f   ( N u m b e r ( t m p V a l u e ) < 0 )  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 e l s e   {  
 	 	 	 i f   ( N u m b e r ( t m p V a l u e ) < = m a x v a l u 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   C o m p r o b a r N u m e r o E n t e r o ( N u m e r o , S o l o P o s i t i v o )   {  
 	 / *   C o m p r u e b a   s i   l o   q u e   s e   p a s a   e n   e l   p a r á m e t r o   n ú m e r o   e n   u n   n ú m e r o   e n t e r o  
 	       O p c i o n a l m e n t e   p u e d e   c o m p r o b a r   s i   e s   s ó l o   p o s i t i v o   * /  
 	 v a r   a n s w e r , i ;  
  
 	 a n s w e r = t r u e ;  
 	  
  
 	 i f   ( N u m e r o = = " " )  
 	 	 a n s w e r = f a l s e ;  
 	 e l s e   {  
 	 	 i f   ( S o l o P o s i t i v o )   {  
 	 	 	 f o r   ( i = 0 ;   i < N u m e r o . l e n g t h ;   i + + )   {  
 	 	 	 	 i f   ( N u m e r o . c h a r A t ( i ) < " 0 "   | |   N u m e r o . c h a r A t ( i ) > " 9 " ) {  
 	 	 	 	 	 a n s w e r   =   f a l s e ;  
 	 	 	 	 	 b r e a k ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 f o r   ( i = 0 ;   i < N u m e r o . l e n g t h ;   i + + )   {  
 	 	 	 	 i f   ( N u m e r o . c h a r A t ( i ) < " 0 "   | |   N u m e r o . c h a r A t ( i ) > " 9 " ) {  
 	 	 	 	 	 i f   ( N u m e r o . c h a r A t ( i ) = = " - " )   {  
 	 	 	 	 	 	 i f   ( i = = 0 )  
 	 	 	 	 	 	 	 a n s w e r = t r u e ;  
 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 a n s w e r = f a l s e ;  
 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 a n s w e r = f a l s e ;  
 	 	 	 	 }  
 	 	 	 } 	 	  
 	 	 }  
 	 }  
 	 	  
 	 r e t u r n   a n s w e r ;  
 }  
  
 f u n c t i o n   A n y o E s B i s i e s t o ( A n y o )   {  
 	 v a r   A n y o N u m ;  
 	  
 	 A n y o N u m = N u m b e r ( A n y o ) ;  
 	  
 	 i f   ( ( A n y o % 4 ) ! = 0 )  
 	 	 r e t u r n   f a l s e ;  
 	 e l s e   {  
 	 	 i f   ( ( A n y o % 1 0 0 ) ! = 0 )  
 	 	 	 r e t u r n   t r u e ;  
 	 	 e l s e   {  
 	 	 	 i f   ( ( A n y o % 4 0 0 ) ! = 0 )  
 	 	 	 	 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 ;  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   F e c h a C o r r e c t a ( F e c h a )   {  
 	 v a r   M i F e c h a , s p l i t F e c h a ;  
  
 	 M i F e c h a = n e w   S t r i n g ( F e c h a ) ;  
 	 s p l i t F e c h a = M i F e c h a . s p l i t ( " / " ) ;  
 	  
 	 i f   ( s p l i t F e c h a . l e n g t h ! = 3 )  
 	 	 r e t u r n   f a l s e ;  
 	 e l s e   {  
 	 	 i f   ( i s N a N ( s p l i t F e c h a [ 0 ] )   | |   i s N a N ( s p l i t F e c h a [ 1 ] )   | |   i s N a N ( s p l i t F e c h a [ 2 ] ) )  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 e l s e  
 	 	 	 i f   ( ( N u m b e r ( s p l i t F e c h a [ 0 ] ) < 1 )   | |   ( N u m b e r ( s p l i t F e c h a [ 0 ] ) > 3 1 )   | |   ( N u m b e r ( s p l i t F e c h a [ 1 ] ) < 1 )   | |   ( N u m b e r ( s p l i t F e c h a [ 1 ] ) > 1 2 ) )  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 e l s e  
 	 	 	 	 i f   ( s p l i t F e c h a [ 2 ] . l e n g t h ! = 4 )  
 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 e l s e 	 	 	 	  
 	 	 	 	 	 i f   ( N u m b e r ( s p l i t F e c h a [ 0 ] ) = = 3 1 )  
 	 	 	 	 	 	 i f   ( N u m b e r ( s p l i t F e c h a [ 1 ] ) = = 4   | |   N u m b e r ( s p l i t F e c h a [ 1 ] ) = = 6   | |   N u m b e r ( s p l i t F e c h a [ 1 ] ) = = 9   | |   N u m b e r ( s p l i t F e c h a [ 1 ] ) = = 1 1   | |   N u m b e r ( s p l i t F e c h a [ 1 ] ) = = 2 )  
 	 	 	 	 	 	 	 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 ;  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 i f   ( ( N u m b e r ( s p l i t F e c h a [ 0 ] ) > 2 8 )   & &   ( N u m b e r ( s p l i t F e c h a [ 1 ] ) = = 2 ) )  
 	 	 	 	 	 	 	 i f   ( ( A n y o E s B i s i e s t o ( s p l i t F e c h a [ 2 ] ) )   & &   ( N u m b e r ( s p l i t F e c h a [ 0 ] ) = = 2 9 ) )  
 	 	 	 	 	 	 	 	 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   t r u e ;  
 	 }  
 	  
 	 r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   Q u i t a r P u n t o s N u m e r o ( N u m )   {  
 	 / / Q u i t a   l o s   p o s i b l e s   p u n t o s   d e c i m a l e s   q u e   p u e d a   t e n e r   u n   n ú m e r o  
 	 v a r   T m p , V a l o r e s , i , R e s ;  
 	  
 	 T m p = n e w   S t r i n g ( N u m ) ;  
 	 V a l o r e s = T m p . s p l i t ( " . " ) ;  
 	 i = 0 ;  
 	 R e s = " " ;  
 	  
 	 w h i l e ( i < V a l o r e s . l e n g t h )   {  
 	 	 R e s = R e s + V a l o r e s [ i ] ;  
 	 	 i = i + 1 ;  
 	 }  
 	  
 	 r e t u r n   R e s ;  
 }  
  
 f u n c t i o n   C o m p r o b a r N u m ( n u m b e r )   {  
 	 v a r   n u m C o m p r o b a c i o n ,   c o n t C o m a s ,   a n s w e r ;  
 	  
 	 i f   ( n u m b e r = = ' ' )  
 	 	 a n s w e r = 0 ;  
 	 e l s e   {  
 	 	 a n s w e r = 1 ;  
 	 	 n u m C o m p r o b a c i o n = n e w   S t r i n g ( n u m b e r ) ;  
 	 	 n u m C o m p r o b a c i o n . r e p l a c e ( / \ . / g , ' ' ) ;  
 	 	 c o n t C o m a s = 0 ;  
  
 	 	 f o r   ( v a r   i = 0 ;   i < n u m C o m p r o b a c i o n . l e n g t h ;   i + + )   {  
 	 	 	 i f   ( i = = 0 )   {  
 	 	 	 	 i f   ( ( n u m C o m p r o b a c i o n . c h a r C o d e A t ( i ) < 4 8   | |   n u m C o m p r o b a c i o n . c h a r C o d e A t ( i ) > 5 7 )   & &   n u m C o m p r o b a c i o n . c h a r A t ( i ) ! = " + "   & &   n u m C o m p r o b a c i o n . c h a r A t ( i ) ! = " - " ) {  
 	 	 	 	 	 a n s w e r = 0 ;  
 	 	 	 	 	 b r e a k ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 / / N o   e s   e l   p r i m e r   c a r a c t e r .   S o l o   p u e d e   h a b e r   d í g i t o s   o   u n a   c o m a   e n   e l   c a s o   d e   q u e   c o n t C o m a s   s e a   0  
 	 	 	 	 i f   ( ( n u m C o m p r o b a c i o n . c h a r C o d e A t ( i ) < 4 8   | |   n u m C o m p r o b a c i o n . c h a r C o d e A t ( i ) > 5 7 )   & &   n u m C o m p r o b a c i o n . c h a r A t ( i ) ! = " , " )   {  
 	 	 	 	 	 a n s w e r = 0 ;  
 	 	 	 	 	 b r e a k ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 i f   ( n u m C o m p r o b a c i o n . c h a r A t ( i ) = = " , " )   {  
 	 	 	 	 	 	 i f   ( c o n t C o m a s = = 0 )  
 	 	 	 	 	 	 	 c o n t C o m a s = c o n t C o m a s + 1 ;  
 	 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 	 a n s w e r = 0 ;  
 	 	 	 	 	 	 	 b r e a k ; 	 	 	 	 	 	 	 	 	  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 i f   ( n u m C o m p r o b a c i o n . c h a r C o d e A t ( i ) < 4 8   | |   n u m C o m p r o b a c i o n . c h a r C o d e A t ( i ) > 5 7 )   {  
 	 	 	 	 	 	 	 a n s w e r = 0 ;  
 	 	 	 	 	 	 	 b r e a k ; 	 	 	 	  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } 	 	 	  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 	  
 	 r e t u r n   a n s w e r ;  
 }    
  
 f u n c t i o n   E s C a n t i d a d E u r o V a l i d a ( C a n t i d a d )   {  
 	 v a r   S p l i t C a n t , M i S t r , c a n t , S u m a U n o , R e d o n d e o ;  
  
 	 i f   ( C o m p r o b a r N u m ( C a n t i d a d ) = = 1 )   {  
 	 	 M i S t r = n e w   S t r i n g ( C a n t i d a d ) ;  
 	 	 S p l i t C a n t = M i S t r . s p l i t ( " , " ) ;  
 	 	  
 	 	 i f   ( S p l i t C a n t . l e n g t h = = 2 )   {  
 	 	 	 s w i t c h   ( S p l i t C a n t [ 1 ] . l e n g t h )   {  
 	 	 	 	 c a s e   0 :  
 	 	 	 	 	 i f   ( S p l i t C a n t [ 0 ] = = " + "   | |   S p l i t C a n t [ 0 ] = = " - " )  
 	 	 	 	 	 	 c a n t = S p l i t C a n t [ 0 ] + ' 0 , 0 0 ' ;  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 c a n t = C a n t i d a d + ' 0 0 ' ;  
 	 	 	 	 	 b r e a k ;  
 	 	 	 	 c a s e   1 :  
 	 	 	 	 	 i f   ( S p l i t C a n t [ 0 ] = = " + "   | |   S p l i t C a n t [ 0 ] = = " - " )  
 	 	 	 	 	 	 c a n t = S p l i t C a n t [ 0 ] + ' 0 , '   +   S p l i t C a n t [ 1 ]   +   ' 0 ' ;  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 c a n t = C a n t i d a d + ' 0 ' ;  
 	 	 	 	 	 b r e a k ;  
 	 	 	 	 c a s e   2 :  
 	 	 	 	 	 i f   ( S p l i t C a n t [ 0 ] = = " + "   | |   S p l i t C a n t [ 0 ] = = " - " )  
 	 	 	 	 	 	 c a n t = S p l i t C a n t [ 0 ] + ' 0 , '   +   S p l i t C a n t [ 1 ] ;  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 c a n t = C a n t i d a d ;  
 	 	 	 	 	 b r e a k ;  
 	 	 	 	 d e f a u l t :  
 	 	 	 	 	 / / E s   m a y o r   q u e   2 .   H a y   q u e   h a c e r   u n   r e d o n d e o  
 	 	 	 	 	 i f   ( S p l i t C a n t [ 1 ] . c h a r A t ( 2 ) > = " 5 " )   {  
 	 	 	 	 	 	 R e d o n d e o = p a r s e I n t ( S p l i t C a n t [ 1 ] . c h a r A t ( 0 )   +   S p l i t C a n t [ 1 ] . c h a r A t ( 1 ) ) + 1 ;  
 	 	 	 	 	 	 i f   ( R e d o n d e o = = 1 0 0 )   {  
 	 	 	 	 	 	 	 S u m a U n o = p a r s e F l o a t ( S p l i t C a n t [ 0 ] ) + 1 ;  
 	 	 	 	 	 	 	 c a n t = n e w   S t r i n g ( S u m a U n o   +   " , 0 0 " )  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 i f   ( R e d o n d e o < 1 0 )  
 	 	 	 	 	 	 	 	 c a n t = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , 0 "   +   R e d o n d e o ) ;  
 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 c a n t = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   R e d o n d e o ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 c a n t = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ] . c h a r A t ( 0 )   +   S p l i t C a n t [ 1 ] . c h a r A t ( 1 ) ) ;  
  
 	 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 i f   ( S p l i t C a n t [ 0 ] = = " + "   | |   S p l i t C a n t [ 0 ] = = " - " )  
 	 	 	 	 c a n t = S p l i t C a n t [ 0 ] + ' 0 , 0 0 '  
 	 	 	 e l s e  
 	 	 	 	 c a n t = C a n t i d a d   +   ' , 0 0 ' ;  
 	 	 }  
 	 }  
 	 e l s e  
 	 	 c a n t = " X " ;  
 	  
 	 r e t u r n   c a n t ;  
 }  
  
 f u n c t i o n   P o n e r P u n t o s C a n t i d a d ( C a n t i d a d )   {  
 	 v a r   P o s , T m p , D e c i m a l e s , R e s u l t a d o , S i g n o ;  
 	  
 	 T m p = n e w   S t r i n g ( C a n t i d a d ) ;  
 	  
 	 i f   ( I z q u i e r d a ( T m p , 1 ) = = " + "   | |   I z q u i e r d a ( T m p , 1 ) = = " - " )   {  
 	 	 S i g n o = I z q u i e r d a ( T m p , 1 ) ;  
 	 	 T m p = n e w   S t r i n g ( D e r e c h a ( T m p , T m p . l e n g t h - 1 ) ) ;  
 	 }  
 	 e l s e  
 	 	 S i g n o = " " ;  
  
 	 P o s = T m p . s p l i t ( " . " ) ;  
  
 	 i f   ( P o s . l e n g t h > 1 )  
 	 	 T m p = n e w   S t r i n g ( P o s [ 0 ]   +   " , "   +   P o s [ 1 ] ) ;  
  
 	 / / T m p = n e w   S t r i n g ( C a n t i d a d ) ;  
 	 P o s = T m p . s p l i t ( " , " ) ;  
  
 	 T m p = P o s [ 0 ] ;  
  
 	 i f   ( P o s . l e n g t h = = 1 )  
 	 	 D e c i m a l e s = " " ;  
 	 e l s e   {  
 	 	 D e c i m a l e s =   " , "   +   P o s [ 1 ] ;  
 	 }  
  
 	 / / i f   ( T m p . c h a r A t ( 0 ) = = " - "   | |   T m p . c h a r A t ( 0 ) = = " + " )   {  
 	 / / 	 S i g n o = T m p . c h a r A t ( 0 ) ;  
 	 / / 	 T m p = D e r e c h a ( T m p , T m p . l e n g t h - 1 ) ;  
 	 / / }  
 	 / / e l s e  
 	 / / 	 S i g n o = " " ;  
 	  
 	 i f   ( T m p . l e n g t h > = 4 )   {  
 	 	 v a r   i ;  
 	 	  
 	 	 i = 1 ;  
 	 	 R e s u l t a d o = " " ;  
  
 	 	 w h i l e   ( ( i * 3 ) < = T m p . l e n g t h )   {  
 	 	 	 R e s u l t a d o =   " . "   +   I z q u i e r d a ( D e r e c h a ( T m p , i * 3 ) , 3 )   +   R e s u l t a d o ;  
 	 	 	 i = i + 1 ;  
 	 	 }  
  
 	 	 i f   ( ( i - 1 ) * 3 < T m p . l e n g t h )  
 	 	 	 R e s u l t a d o = I z q u i e r d a ( T m p , T m p . l e n g t h - ( ( i - 1 ) * 3 ) )   +   R e s u l t a d o ;  
  
 	 	 i f   ( I z q u i e r d a ( R e s u l t a d o , 1 ) = = " . " )  
 	 	 	 R e s u l t a d o = D e r e c h a ( R e s u l t a d o , R e s u l t a d o . l e n g t h - 1 )   +   D e c i m a l e s ;  
 	 	 e l s e  
 	 	 	 R e s u l t a d o = R e s u l t a d o   +   D e c i m a l e s ;  
  
 	 	 r e t u r n   S i g n o   +   R e s u l t a d o ;  
 	 }  
 	 e l s e  
 	 	 r e t u r n   S i g n o   +   T m p   +   D e c i m a l e s ;  
  
 }  
  
  
 f u n c t i o n   D e r e c h a ( C a d e n a , C a r s )   {  
 	 v a r   T m p , i , R e s , c o n t ;  
 	  
 	 T m p = n e w   S t r i n g ( C a d e n a ) ;  
 	 i = T m p . l e n g t h - 1 ;  
 	 R e s = " " ;  
 	 c o n t = 0 ;  
 	  
 	 i f   ( C a r s < = T m p . l e n g t h )   {  
 	 	 w h i l e   ( c o n t < C a r s )   {  
 	 	 	 R e s = T m p . c h a r A t ( i ) + R e s ;  
 	 	 	 c o n t + = 1 ;  
 	 	 	 i - = 1 ;  
 	 	 }  
 	 }  
 	  
 	 r e t u r n   R e s ;  
 }  
  
 f u n c t i o n   I z q u i e r d a ( C a d e n a , C a r s )   {  
 	 v a r   T m p , i , R e s ;  
 	  
 	 T m p = n e w   S t r i n g ( C a d e n a ) ;  
 	 i = 0 ;  
 	 R e s = " " ;  
 	  
 	 i f   ( C a r s < = T m p . l e n g t h )   {  
 	 	 w h i l e   ( i < = ( C a r s - 1 ) )   {  
 	 	 	 R e s = R e s   +   T m p . c h a r A t ( i ) ;  
 	 	 	 i + = 1 ;  
 	 	 }  
 	 }  
 	  
 	 r e t u r n   R e s ;  
 }  
  
 f u n c t i o n   Q u i t a r P u n t o s N u m e r o ( N u m )   {  
 	 v a r   T m p , V a l o r e s , i , R e s ;  
 	  
 	 T m p = n e w   S t r i n g ( N u m ) ;  
 	 V a l o r e s = T m p . s p l i t ( " . " ) ;  
 	 i = 0 ;  
 	 R e s = " " ;  
 	  
 	 w h i l e ( i < V a l o r e s . l e n g t h )   {  
 	 	 R e s = R e s + V a l o r e s [ i ] ;  
 	 	 i = i + 1 ;  
 	 }  
 	  
 	 r e t u r n   R e s ;  
 }  
  
 f u n c t i o n   C a m b i a r C o m a A P u n t o ( C a n t i d a d )   {  
 	 v a r   T m p , T m p S p l i t ;  
 	  
 	 T m p = n e w   S t r i n g ( C a n t i d a d ) ;  
 	 T m p S p l i t = T m p . s p l i t ( " , " ) ;  
 	  
 	 i f   ( T m p S p l i t . l e n g t h = = 1 )  
 	 	 r e t u r n   C a n t i d a d ;  
 	 e l s e  
 	 	 r e t u r n   T m p S p l i t [ 0 ]   +   " . "   +   T m p S p l i t [ 1 ] ;  
 }  
  
 f u n c t i o n   C a m b i a r P u n t o A C o m a ( C a n t i d a d )   {  
 	 v a r   T m p , T m p S p l i t ;  
 	  
 	 T m p = n e w   S t r i n g ( C a n t i d a d ) ;  
 	 T m p S p l i t = T m p . s p l i t ( " . " ) ;  
 	  
 	 i f   ( T m p S p l i t . l e n g t h = = 1 )  
 	 	 r e t u r n   C a n t i d a d ;  
 	 e l s e  
 	 	 r e t u r n   T m p S p l i t [ 0 ]   +   " , "   +   T m p S p l i t [ 1 ] ;  
 }  
  
 f u n c t i o n   F e c h a s F i l t r o C o r r e c t a s ( F e c h a D e s d e , F e c h a H a s t a )   {  
 	 v a r   s p l i t F e c h a D e s d e ,   s p l i t F e c h a H a s t a ;  
  
 	 s p l i t F e c h a D e s d e = n e w   S t r i n g ( F e c h a D e s d e ) . s p l i t ( " / " ) ;  
 	 s p l i t F e c h a H a s t a = n e w   S t r i n g ( F e c h a H a s t a ) . s p l i t ( " / " ) ;  
 	  
 	 i f   ( N u m b e r ( s p l i t F e c h a D e s d e [ 2 ] ) < = N u m b e r ( s p l i t F e c h a H a s t a [ 2 ] ) )   {  
 	 	 i f   ( N u m b e r ( s p l i t F e c h a D e s d e [ 2 ] ) = = N u m b e r ( s p l i t F e c h a H a s t a [ 2 ] ) )   {  
 	 	 	 i f   ( N u m b e r ( s p l i t F e c h a D e s d e [ 1 ] ) < = N u m b e r ( s p l i t F e c h a H a s t a [ 1 ] ) )   {  
 	 	 	 	 i f   ( N u m b e r ( s p l i t F e c h a D e s d e [ 1 ] ) = = N u m b e r ( s p l i t F e c h a H a s t a [ 1 ] ) )   {  
 	 	 	 	 	 i f   ( N u m b e r ( s p l i t F e c h a D e s d e [ 0 ] ) < = N u m b e r ( s p l i t F e c h a H a s t a [ 0 ] ) )  
 	 	 	 	 	 	 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   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   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   R e d o n d e a r ( v a l u e ,   p r e c i s i o n )  
 	 	 {  
                 v a l u e   =   " "   +   v a l u e   / / c o n v e r t   v a l u e   t o   s t r i n g  
                 p r e c i s i o n   =   p a r s e I n t ( p r e c i s i o n ) ;  
                 v a r   w h o l e   =   " "   +   M a t h . r o u n d ( v a l u e   *   M a t h . p o w ( 1 0 ,   p r e c i s i o n ) ) ;  
  
                 v a r   d e c P o i n t   =   w h o l e . l e n g t h   -   p r e c i s i o n ;  
  
                 i f ( d e c P o i n t   ! =   0 )  
                 {  
                                 r e s u l t   =   w h o l e . s u b s t r i n g ( 0 ,   d e c P o i n t ) ;  
                                 r e s u l t   + =   " . " ;  
                                 r e s u l t   + =   w h o l e . s u b s t r i n g ( d e c P o i n t ,   w h o l e . l e n g t h ) ;  
                 }  
                 e l s e  
                 {  
                                 r e s u l t   =   0 ;  
                                 r e s u l t   + =   " . " ;  
                                 r e s u l t   + =   w h o l e . s u b s t r i n g ( d e c P o i n t ,   w h o l e . l e n g t h ) ;  
                 }  
                 r e t u r n   r e s u l t ;  
 }  
  
 f u n c t i o n   C a r a c t e r e s N u l o s ( O b j )   {  
 	 	 v a r   i , T m p , N o V a l i d o ;  
 	 	  
 	 	 N o V a l i d o = 0 ;  
 	 	  
 	 	 T m p = n e w   S t r i n g ( O b j . v a l u e ) ;  
 	 	 f o r   ( i = 0 ; i < = T m p . l e n g t h - 1 ; i + + )   {  
 	 	 	 i f   ( ( T m p . c h a r C o d e A t ( i ) < 4 8 )   | |   ( T m p . c h a r C o d e A t ( i ) > 5 7 ) )  
   	 	 	 	 i f   ( ( T m p . c h a r A t ( i ) ! = " . " )   & &   ( T m p . c h a r A t ( i ) ! = " , " ) )  
 	 	 	 	 	 N o V a l i d o = 1 ;  
 	 	 }  
 	 	 	 	  
 	 	 i f   ( N o V a l i d o = = 0 )  
 	 	 	 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 ;  
 }  
 	  
 f u n c t i o n   F o r m a t e a r N u m e r o ( N u m e r o , F o r m a t o )   {  
 	 v a r   M i C a n t i d a d , S p l i t C a n t ;  
  
 	 M i C a n t i d a d = n e w   S t r i n g ( N u m e r o ) ;  
 	 S p l i t C a n t = M i C a n t i d a d . s p l i t ( " . " ) ;  
  
 	 i f   ( S p l i t C a n t . l e n g t h > 1 )  
 	 	 N u m e r o = S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ] ;  
  
 	 s w i t c h   ( F o r m a t o )   {  
 	 	 c a s e   " N o r m a l " :  
 	 	 	 / /   S i n   d e c i m a l e s 	 	  
 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( N u m e r o ) ;  
 	 	 	 S p l i t C a n t = M i C a n t i d a d . s p l i t ( " , " ) ;  
 	 	 	  
 	 	 	 i f   ( S p l i t C a n t . l e n g t h > 1 )  
 	 	 	 	 i f   ( S p l i t C a n t [ 1 ] . c h a r A t ( 0 ) > = " 5 " )  
 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( p a r s e F l o a t ( S p l i t C a n t [ 0 ] ) + 1 ) ;  
 	 	 	 	 e l s e  
 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ] ) ;  
  
 	 	 	 b r e a k ;  
  
 	 	 c a s e   " S t a n d a r d " :  
 	 	 	 / /   D o s   d e c i m a l e s  
 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( N u m e r o ) ;  
 	 	 	 S p l i t C a n t = M i C a n t i d a d . s p l i t ( " , " ) ;  
 	 	 	  
 	 	 	 i f   ( S p l i t C a n t . l e n g t h > 1 )  
 	 	 	 	 i f   ( S p l i t C a n t [ 1 ] . l e n g t h > 2 )  
 	 	 	 	 	 i f   ( S p l i t C a n t [ 1 ] . c h a r A t ( 2 ) > = " 5 " )   {  
 	 	 	 	 	 	 v a r   D o s D e c , T m p ;  
 	 	 	 	 	 	  
 	 	 	 	 	 	 D o s D e c = S p l i t C a n t [ 1 ] . c h a r A t ( 0 ) + S p l i t C a n t [ 1 ] . c h a r A t ( 1 ) ;  
 	 	 	 	 	 	 T m p = p a r s e I n t ( D o s D e c ) + 1 ;  
 	 	 	 	 	 	  
 	 	 	 	 	 	 i f   ( T m p < 1 0 )  
 	 	 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , 0 "   +   T m p ) ;  
 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 i f   ( T m p < 1 0 0 )  
 	 	 	 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   T m p ) ;  
 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( p a r s e I n t ( S p l i t C a n t [ 0 ] ) + 1   +   " , 0 0 " ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ] . c h a r A t ( 0 )   +   S p l i t C a n t [ 1 ] . c h a r A t ( 1 ) ) ;  
 	 	 	 	 e l s e  
 	 	 	 	 	 i f   ( S p l i t C a n t [ 1 ] . l e n g t h = = 2 )  
 	 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ] ) ;  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ]   +   " 0 " ) ;  
 	 	 	 e l s e  
 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , 0 0 " ) ;  
 	 	 	 b r e a k ; 	 	  
 	 } 	 	 	  
 	  
 	 r e t u r n   ( M i C a n t i d a d ) ;  
 }  
  
  
  
 f u n c t i o n   R e p e a t C h a r ( c a r , r e p e a t s )   {  
 	 v a r   i , r e t v a l ;  
 	  
 	 r e t v a l = " " ;  
 	  
 	 f o r   ( i = 1 ; i < = r e p e a t s ; i + + )  
 	 	 r e t v a l = r e t v a l + c a r ;  
 	  
 	 r e t u r n   r e t v a l ;  
 }  
  
 f u n c t i o n   E x p ( b a s e ,   e x p )   {  
 	 v a r   f b a s e   =   b a s e ;  
 	 v a r   f e x p   =   e x p ;  
 	 v a r   c o u n t   =   1 ;  
 	 v a r   f e q u a l s ;  
  
 	 i f ( f e x p   <   0 )   { f e x p   =   - 1   *   f e x p ;   }   e l s e   { f e x p   =   f e x p ;   }  
  
 	 w h i l e ( c o u n t   <   f e x p )   {  
 	 	 f b a s e   =   f b a s e   *   b a s e ;  
 	 	 c o u n t   =   c o u n t   +   1 ;  
  
 	 	 i f ( c o u n t   >   6 0 0 )   {   b r e a k ;   }   e l s e   {   c o n t i n u e ;   }  
 	 }  
  
 	 i f ( e x p   <   0 )   { f e q u a l s   =   1   /   f b a s e ;   }   e l s e   i f   ( e x p   = =   0 )   { f e q u a l s   =   1 ;   }   e l s e   { f e q u a l s   =   f b a s e ;   }  
  
 	 r e t u r n   f e q u a l s ;  
 } 	 	  
  
 f u n c t i o n   F o r m a t e a r N u m e r o D e c i m a l e s ( N u m e r o , D e c i m a l e s )   {  
 	 v a r   M i C a n t i d a d , S p l i t C a n t ;  
  
 	 M i C a n t i d a d = n e w   S t r i n g ( N u m e r o ) ;  
 	 S p l i t C a n t = M i C a n t i d a d . s p l i t ( " . " ) ;  
  
 	 i f   ( S p l i t C a n t . l e n g t h > 1 )  
 	 	 N u m e r o = S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ] ;  
  
  
 	 / /   T r a t a r   d e c i m a l e s  
 	 M i C a n t i d a d = n e w   S t r i n g ( N u m e r o ) ;  
 	 S p l i t C a n t = M i C a n t i d a d . s p l i t ( " , " ) ;  
 	  
 	 i f   ( S p l i t C a n t . l e n g t h > 1 )  
 	 	 i f   ( S p l i t C a n t [ 1 ] . l e n g t h > D e c i m a l e s )  
 	 	 	 i f   ( S p l i t C a n t [ 1 ] . c h a r A t ( D e c i m a l e s ) > = " 5 " )   {  
 	 	 	 	 v a r   V a r i o s D e c , T m p ;  
 	 	 	 	  
 	 	 	 	 V a r i o s D e c = I z q u i e r d a ( S p l i t C a n t [ 1 ] , D e c i m a l e s ) ;  
 	 	 	 	 T m p = p a r s e I n t ( V a r i o s D e c ) + 1 ;  
 	 	 	 	  
 	 	 	 	 i f   ( T m p < E x p ( 1 0 , D e c i m a l e s ) ) {  
 	 	 	 	 	 v a r   T m p S t r ;  
 	 	 	 	 	  
 	 	 	 	 	 T m p S t r = n e w   S t r i n g ( T m p ) ;  
 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   R e p e a t C h a r ( " 0 " , D e c i m a l e s - T m p S t r . l e n g t h )   +   T m p ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( p a r s e I n t ( S p l i t C a n t [ 0 ] ) + 1   +   " , "   +   R e p e a t C h a r ( " 0 " , D e c i m a l e s ) ) ; 	 	 	 	  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   I z q u i e r d a ( S p l i t C a n t [ 1 ] , D e c i m a l e s ) ) ;  
 	 	 e l s e  
 	 	 	 i f   ( S p l i t C a n t [ 1 ] . l e n g t h = = D e c i m a l e s )  
 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ] ) ;  
 	 	 	 e l s e  
 	 	 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   S p l i t C a n t [ 1 ]   +   R e p e a t C h a r ( " 0 " , D e c i m a l e s - S p l i t C a n t [ 1 ] . l e n g t h ) ) ;  
 	 e l s e  
 	 	 M i C a n t i d a d = n e w   S t r i n g ( S p l i t C a n t [ 0 ]   +   " , "   +   R e p e a t C h a r ( " 0 " , D e c i m a l e s ) ) ;  
 	  
 	 r e t u r n   ( M i C a n t i d a d ) ;  
 }  
  
 f u n c t i o n   t o o l t i p ( i d , v i s ) {  
 	 v a r   c a p a ;  
 	 i f ( d o c u m e n t . a l l )  
 	 { c a p a = d o c u m e n t . a l l [ i d ] . s t y l e ;  
 	 i f   ( c a p a )  
 	 c a p a . v i s i b i l i t y   =   v i s   ?   " v i s i b l e " : " h i d d e n " ;  
 	 }  
 	 e l s e  
 	 i f ( d o c u m e n t . l a y e r s )  
 	 { c a p a = d o c u m e n t . l a y e r s [ i d ] ;  
 	 i f   ( c a p a )  
 	 c a p a . v i s i b i l i t y   =   v i s   ?   " s h o w " : " h i d e " ;  
 	 }  
 	 e l s e  
 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d )  
 	 { c a p a = d o c u m e n t . g e t E l e m e n t B y I d ( i d ) . s t y l e ;  
 	 i f   ( c a p a )  
 	 c a p a . v i s i b i l i t y   =   v i s   ?   " v i s i b l e " : " h i d d e n " ;  
 	 }  
 	 r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   D a t e A d d ( T i p o I n t e r v a l o , C u a n t o s , F e c h a ) {  
         v a r   a n i o = N u m b e r ( F e c h a . s p l i t ( " / " ) [ 2 ] ) ;  
         v a r   m e s = N u m b e r ( F e c h a . s p l i t ( " / " ) [ 1 ] ) ;  
         v a r   d i a = N u m b e r ( F e c h a . s p l i t ( " / " ) [ 0 ] ) ;  
          
         i f   ( N u m b e r ( C u a n t o s ) = = 0 ) {  
                 r e t u r n   F e c h a ;  
         } e l s e {          
                 s w i t c h ( T i p o I n t e r v a l o ) {  
                         c a s e   " m e s " :  
                                 v a r   c a n t i d a d   = m e s + N u m b e r ( C u a n t o s ) ;  
                                 a n i o + = ( c a n t i d a d - ( c a n t i d a d % 1 2 ) ) / 1 2 ;  
                                 m e s = c a n t i d a d % 1 2 ;  
                                 b r e a k ;  
                 }  
                 v a r   F e c h a F i n a l = d i a + " / " + m e s + " / " + a n i o ;  
                  
                 w h i l e ( ! F e c h a C o r r e c t a ( F e c h a F i n a l ) ) {  
                         d i a = d i a - 1 ;  
                         F e c h a F i n a l = d i a + " / " + m e s + " / " + a n i o ;  
                 }  
         }  
          
         r e t u r n   F e c h a F i n a l ;  
 }  
  
 f u n c t i o n   R e e m p l a z a r _ C a r a c t e r e s _ E s p e c i a l e s   ( s )   {  
  
         s   =   s . r e p l a c e ( / [ à | á | ä | â | ã | æ | å ] / , " a " ) ;  
         s   =   s . r e p l a c e ( / [ è | é | ë | ê ] / , " e " ) ;            
         s   =   s . r e p l a c e ( / [ ì | í | î | )| ï ] / , " i " ) ;            
         s   =   s . r e p l a c e ( / [ ò | ó | ô | õ | ö ] / , " o " ) ;            
         s   =   s . r e p l a c e ( / [ ù | ú | û | ü ] / , " u " ) ;            
         s   =   s . r e p l a c e ( / [ | 	| | | Ç | ç ] / , " c " ) ;            
         s   =   s . r e p l a c e ( " ñ " , " n " ) ;            
         s   =   s . r e p l a c e ( " " , " g " ) ;            
         s   =   s . r e p l a c e ( " H" , " n " ) ;            
         s   =   s . r e p l a c e ( " u" , " w " ) ;            
         s   =   s . r e p l a c e ( " w" , " y " ) ;            
         s   =   s . r e p l a c e ( " ~" , " z " ) ;            
         s   =   s . r e p l a c e ( / [ ª | º | \ | ! | · | # | $ | % | & | / | ( | ) | = | ? | ¿ | ^ | * | + | - | { | } ] / , " " ) ;            
          
        
         r e t u r n   s ;  
 }        
  
 f u n c t i o n   V a l i d a r _ E m a i l ( v a l o r )   {  
          
     i f   ( / ^ \ w + ( [ \ . - ] ? \ w + ) * @ \ w + ( [ \ . - ] ? \ w + ) * ( \ . \ w { 2 , 3 } ) + $ / . t e s t ( v a l o r ) ) {          
                 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 ;  
     }  
  
 } 
