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