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

