ÿþ 
 v a r   N S 4   =   ( d o c u m e n t . l a y e r s ) ;   / /   W h i c h   b r o w s e r ?  
 v a r   I E 4   =   ( d o c u m e n t . a l l ) ;  
  
 v a r   w i n   =   w i n d o w ;   / /   w i n d o w   t o   s e a r c h .  
 v a r   n =   0 ;  
  
 f u n c t i o n   f i n d I n P a g e ( s t r )   {  
  
     v a r   t x t ,   i ,   f o u n d ;  
  
     i f   ( s t r   = =   " " )  
   r e t u r n   f a l s e ;  
  
     / /   F i n d   n e x t   o c c u r a n c e   o f   t h e   g i v e n   s t r i n g   o n   t h e   p a g e ,   w r a p   a r o u n d   t o   t h e  
     / /   s t a r t   o f   t h e   p a g e   i f   n e c e s s a r y .  
  
     i f   ( N S 4 )   {  
  
   / /   L o o k   f o r   m a t c h   s t a r t i n g   a t   t h e   c u r r e n t   p o i n t .   I f   n o t   f o u n d ,   r e w i n d  
   / /   b a c k   t o   t h e   f i r s t   m a t c h .  
  
   i f   ( ! w i n . f i n d ( s t r ) )  
 w h i l e ( w i n . f i n d ( s t r ,   f a l s e ,   t r u e ) )  
     n + + ;  
   e l s e  
 n + + ;  
  
   / /   I f   n o t   f o u n d   i n   e i t h e r   d i r e c t i o n ,   g i v e   m e s s a g e .  
  
   i f   ( n   = =   0 )  
 a l e r t ( " N o t   f o u n d . " ) ;  
     }  
  
     i f   ( I E 4 )   {  
   t x t   =   w i n . d o c u m e n t . b o d y . c r e a t e T e x t R a n g e ( ) ;  
  
   / /   F i n d   t h e   n t h   m a t c h   f r o 
