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