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