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