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