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