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