ÿþ/ * 
   *   j Q u e r y   U I   D a t e p i c k e r   @ V E R S I O N 
   * 
   *   C o p y r i g h t   ( c )   2 0 0 9   A U T H O R S . t x t   ( h t t p : / / j q u e r y u i . c o m / a b o u t ) 
   *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   ( M I T - L I C E N S E . t x t ) 
   *   a n d   G P L   ( G P L - L I C E N S E . t x t )   l i c e n s e s . 
   * 
   *   h t t p : / / d o c s . j q u e r y . c o m / U I / D a t e p i c k e r 
   * 
   *   D e p e n d s : 
   * 	 u i . c o r e . j s 
   * / 
 
 ( f u n c t i o n ( $ )   {   / /   h i d e   t h e   n a m e s p a c e 
 
 $ . e x t e n d ( $ . u i ,   {   d a t e p i c k e r :   {   v e r s i o n :   " @ V E R S I O N "   }   } ) ; 
 
 v a r   P R O P _ N A M E   =   ' d a t e p i c k e r ' ; 
 
 / *   D a t e   p i c k e r   m a n a g e r . 
       U s e   t h e   s i n g l e t o n   i n s t a n c e   o f   t h i s   c l a s s ,   $ . d a t e p i c k e r ,   t o   i n t e r a c t   w i t h   t h e   d a t e   p i c k e r . 
       S e t t i n g s   f o r   ( g r o u p s   o f )   d a t e   p i c k e r s   a r e   m a i n t a i n e d   i n   a n   i n s t a n c e   o b j e c t , 
       a l l o w i n g   m u l t i p l e   d i f f e r e n t   s e t t i n g s   o n   t h e   s a m e   p a g e .   * / 
 
 f u n c t i o n   D a t e p i c k e r ( )   { 
 	 t h i s . d e b u g   =   f a l s e ;   / /   C h a n g e   t h i s   t o   t r u e   t o   s t a r t   d e b u g g i n g 
 	 t h i s . _ c u r I n s t   =   n u l l ;   / /   T h e   c u r r e n t   i n s t a n c e   i n   u s e 
 	 t h i s . _ k e y E v e n t   =   f a l s e ;   / /   I f   t h e   l a s t   e v e n t   w a s   a   k e y   e v e n t 
 	 t h i s . _ d i s a b l e d I n p u t s   =   [ ] ;   / /   L i s t   o f   d a t e   p i c k e r   i n p u t s   t h a t   h a v e   b e e n   d i s a b l e d 
 	 t h i s . _ d a t e p i c k e r S h o w i n g   =   f a l s e ;   / /   T r u e   i f   t h e   p o p u p   p i c k e r   i s   s h o w i n g   ,   f a l s e   i f   n o t 
 	 t h i s . _ i n D i a l o g   =   f a l s e ;   / /   T r u e   i f   s h o w i n g   w i t h i n   a   " d i a l o g " ,   f a l s e   i f   n o t 
 	 t h i s . _ m a i n D i v I d   =   ' u i - d a t e p i c k e r - d i v ' ;   / /   T h e   I D   o f   t h e   m a i n   d a t e p i c k e r   d i v i s i o n 
 	 t h i s . _ i n l i n e C l a s s   =   ' u i - d a t e p i c k e r - i n l i n e ' ;   / /   T h e   n a m e   o f   t h e   i n l i n e   m a r k e r   c l a s s 
 	 t h i s . _ a p p e n d C l a s s   =   ' u i - d a t e p i c k e r - a p p e n d ' ;   / /   T h e   n a m e   o f   t h e   a p p e n d   m a r k e r   c l a s s 
 	 t h i s . _ t r i g g e r C l a s s   =   ' u i - d a t e p i c k e r - t r i g g e r ' ;   / /   T h e   n a m e   o f   t h e   t r i g g e r   m a r k e r   c l a s s 
 	 t h i s . _ d i a l o g C l a s s   =   ' u i - d a t e p i c k e r - d i a l o g ' ;   / /   T h e   n a m e   o f   t h e   d i a l o g   m a r k e r   c l a s s 
 	 t h i s . _ d i s a b l e C l a s s   =   ' u i - d a t e p i c k e r - d i s a b l e d ' ;   / /   T h e   n a m e   o f   t h e   d i s a b l e d   c o v e r i n g   m a r k e r   c l a s s 
 	 t h i s . _ u n s e l e c t a b l e C l a s s   =   ' u i - d a t e p i c k e r - u n s e l e c t a b l e ' ;   / /   T h e   n a m e   o f   t h e   u n s e l e c t a b l e   c e l l   m a r k e r   c l a s s 
 	 t h i s . _ c u r r e n t C l a s s   =   ' u i - d a t e p i c k e r - c u r r e n t - d a y ' ;   / /   T h e   n a m e   o f   t h e   c u r r e n t   d a y   m a r k e r   c l a s s 
 	 t h i s . _ d a y O v e r C l a s s   =   ' u i - d a t e p i c k e r - d a y s - c e l l - o v e r ' ;   / /   T h e   n a m e   o f   t h e   d a y   h o v e r   m a r k e r   c l a s s 
 	 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 
 	 	 c l o s e T e x t :   ' D o n e ' ,   / /   D i s p l a y   t e x t   f o r   c l o s e   l i n k 
 	 	 p r e v T e x t :   ' P r e v ' ,   / /   D i s p l a y   t e x t   f o r   p r e v i o u s   m o n t h   l i n k 
 	 	 n e x t T e x t :   ' N e x t ' ,   / /   D i s p l a y   t e x t   f o r   n e x t   m o n t h   l i n k 
 	 	 c u r r e n t T e x t :   ' T o d a y ' ,   / /   D i s p l a y   t e x t   f o r   c u r r e n t   m o n t h   l i n k 
 	 	 m o n t h N a m e s :   [ ' J a n u a r y ' , ' F e b r u a r y ' , ' M a r c h ' , ' A p r i l ' , ' M a y ' , ' J u n e ' , 
 	 	 	 ' J u l y ' , ' A u g u s t ' , ' S e p t e m b e r ' , ' O c t o b e r ' , ' N o v e m b e r ' , ' D e c e m b e r ' ] ,   / /   N a m e s   o f   m o n t h s   f o r   d r o p - d o w n   a n d   f o r m a t t i n g 
 	 	 m o n t h N a m e s S h o r t :   [ ' J a n ' ,   ' F e b ' ,   ' M a r ' ,   ' A p r ' ,   ' M a y ' ,   ' J u n ' ,   ' J u l ' ,   ' A u g ' ,   ' S e p ' ,   ' O c t ' ,   ' N o v ' ,   ' D e c ' ] ,   / /   F o r   f o r m a t t i n g 
 	 	 d a y N a m e s :   [ ' S u n d a y ' ,   ' M o n d a y ' ,   ' T u e s d a y ' ,   ' W e d n e s d a y ' ,   ' T h u r s d a y ' ,   ' F r i d a y ' ,   ' S a t u r d a y ' ] ,   / /   F o r   f o r m a t t i n g 
 	 	 d a y N a m e s S h o r t :   [ ' S u n ' ,   ' M o n ' ,   ' T u e ' ,   ' W e d ' ,   ' T h u ' ,   ' F r i ' ,   ' S a t ' ] ,   / /   F o r   f o r m a t t i n g 
 	 	 d a y N a m e s M i n :   [ ' S u ' , ' M o ' , ' T u ' , ' W e ' , ' T h ' , ' F r ' , ' S a ' ] ,   / /   C o l u m n   h e a d i n g s   f o r   d a y s   s t a r t i n g   a t   S u n d a y 
 	 	 d a t e F o r m a t :   ' m m / d d / y y ' ,   / /   S e e   f o r m a t   o p t i o n s   o n   p a r s e D a t e 
 	 	 f i r s t D a y :   0 ,   / /   T h e   f i r s t   d a y   o f   t h e   w e e k ,   S u n   =   0 ,   M o n   =   1 ,   . . . 
 	 	 i s R T L :   f a l s e   / /   T r u e   i f   r i g h t - t o - l e f t   l a n g u a g e ,   f a l s e   i f   l e f t - t o - r i g h t 
 	 } ; 
 	 t h i s . _ d e f a u l t s   =   {   / /   G l o b a l   d e f a u l t s   f o r   a l l   t h e   d a t e   p i c k e r   i n s t a n c e s 
 	 	 s h o w O n :   ' f o c u s ' ,   / /   ' f o c u s '   f o r   p o p u p   o n   f o c u s , 
 	 	 	 / /   ' b u t t o n '   f o r   t r i g g e r   b u t t o n ,   o r   ' b o t h '   f o r   e i t h e r 
 	 	 s h o w A n i m :   ' s h o w ' ,   / /   N a m e   o f   j Q u e r y   a n i m a t i o n   f o r   p o p u p 
 	 	 s h o w O p t i o n s :   { } ,   / /   O p t i o n s   f o r   e n h a n c e d   a n i m a t i o n s 
 	 	 d e f a u l t D a t e :   n u l l ,   / /   U s e d   w h e n   f i e l d   i s   b l a n k :   a c t u a l   d a t e , 
 	 	 	 / /   + / - n u m b e r   f o r   o f f s e t   f r o m   t o d a y ,   n u l l   f o r   t o d a y 
 	 	 a p p e n d T e x t :   ' ' ,   / /   D i s p l a y   t e x t   f o l l o w i n g   t h e   i n p u t   b o x ,   e . g .   s h o w i n g   t h e   f o r m a t 
 	 	 b u t t o n T e x t :   ' . . . ' ,   / /   T e x t   f o r   t r i g g e r   b u t t o n 
 	 	 b u t t o n I m a g e :   ' ' ,   / /   U R L   f o r   t r i g g e r   b u t t o n   i m a g e 
 	 	 b u t t o n I m a g e O n l y :   f a l s e ,   / /   T r u e   i f   t h e   i m a g e   a p p e a r s   a l o n e ,   f a l s e   i f   i t   a p p e a r s   o n   a   b u t t o n 
 	 	 h i d e I f N o P r e v N e x t :   f a l s e ,   / /   T r u e   t o   h i d e   n e x t / p r e v i o u s   m o n t h   l i n k s 
 	 	 	 / /   i f   n o t   a p p l i c a b l e ,   f a l s e   t o   j u s t   d i s a b l e   t h e m 
 	 	 n a v i g a t i o n A s D a t e F o r m a t :   f a l s e ,   / /   T r u e   i f   d a t e   f o r m a t t i n g   a p p l i e d   t o   p r e v / t o d a y / n e x t   l i n k s 
 	 	 g o t o C u r r e n t :   f a l s e ,   / /   T r u e   i f   t o d a y   l i n k   g o e s   b a c k   t o   c u r r e n t   s e l e c t i o n   i n s t e a d 
 	 	 c h a n g e M o n t h :   f a l s e ,   / /   T r u e   i f   m o n t h   c a n   b e   s e l e c t e d   d i r e c t l y ,   f a l s e   i f   o n l y   p r e v / n e x t 
 	 	 c h a n g e Y e a r :   f a l s e ,   / /   T r u e   i f   y e a r   c a n   b e   s e l e c t e d   d i r e c t l y ,   f a l s e   i f   o n l y   p r e v / n e x t 
 	 	 s h o w M o n t h A f t e r Y e a r :   f a l s e ,   / /   T r u e   i f   t h e   y e a r   s e l e c t   p r e c e d e s   m o n t h ,   f a l s e   f o r   m o n t h   t h e n   y e a r 
 	 	 y e a r R a n g e :   ' - 1 0 : + 1 0 ' ,   / /   R a n g e   o f   y e a r s   t o   d i s p l a y   i n   d r o p - d o w n , 
 	 	 	 / /   e i t h e r   r e l a t i v e   t o   c u r r e n t   y e a r   ( - n n : + n n )   o r   a b s o l u t e   ( n n n n : n n n n ) 
 	 	 s h o w O t h e r M o n t h s :   f a l s e ,   / /   T r u e   t o   s h o w   d a t e s   i n   o t h e r   m o n t h s ,   f a l s e   t o   l e a v e   b l a n k 
 	 	 c a l c u l a t e W e e k :   t h i s . i s o 8 6 0 1 W e e k ,   / /   H o w   t o   c a l c u l a t e   t h e   w e e k   o f   t h e   y e a r , 
 	 	 	 / /   t a k e s   a   D a t e   a n d   r e t u r n s   t h e   n u m b e r   o f   t h e   w e e k   f o r   i t 
 	 	 s h o r t Y e a r C u t o f f :   ' + 1 0 ' ,   / /   S h o r t   y e a r   v a l u e s   <   t h i s   a r e   i n   t h e   c u r r e n t   c e n t u r y , 
 	 	 	 / /   >   t h i s   a r e   i n   t h e   p r e v i o u s   c e n t u r y , 
 	 	 	 / /   s t r i n g   v a l u e   s t a r t i n g   w i t h   ' + '   f o r   c u r r e n t   y e a r   +   v a l u e 
 	 	 m i n D a t e :   n u l l ,   / /   T h e   e a r l i e s t   s e l e c t a b l e   d a t e ,   o r   n u l l   f o r   n o   l i m i t 
 	 	 m a x D a t e :   n u l l ,   / /   T h e   l a t e s t   s e l e c t a b l e   d a t e ,   o r   n u l l   f o r   n o   l i m i t 
 	 	 d u r a t i o n :   ' n o r m a l ' ,   / /   D u r a t i o n   o f   d i s p l a y / c l o s u r e 
 	 	 b e f o r e S h o w D a y :   n u l l ,   / /   F u n c t i o n   t h a t   t a k e s   a   d a t e   a n d   r e t u r n s   a n   a r r a y   w i t h 
 	 	 	 / /   [ 0 ]   =   t r u e   i f   s e l e c t a b l e ,   f a l s e   i f   n o t ,   [ 1 ]   =   c u s t o m   C S S   c l a s s   n a m e ( s )   o r   ' ' , 
 	 	 	 / /   [ 2 ]   =   c e l l   t i t l e   ( o p t i o n a l ) ,   e . g .   $ . d a t e p i c k e r . n o W e e k e n d s 
 	 	 b e f o r e S h o w :   n u l l ,   / /   F u n c t i o n   t h a t   t a k e s   a n   i n p u t   f i e l d   a n d 
 	 	 	 / /   r e t u r n s   a   s e t   o f   c u s t o m   s e t t i n g s   f o r   t h e   d a t e   p i c k e r 
 	 	 o n S e l e c t :   n u l l ,   / /   D e f i n e   a   c a l l b a c k   f u n c t i o n   w h e n   a   d a t e   i s   s e l e c t e d 
 	 	 o n C h a n g e M o n t h Y e a r :   n u l l ,   / /   D e f i n e   a   c a l l b a c k   f u n c t i o n   w h e n   t h e   m o n t h   o r   y e a r   i s   c h a n g e d 
 	 	 o n C l o s e :   n u l l ,   / /   D e f i n e   a   c a l l b a c k   f u n c t i o n   w h e n   t h e   d a t e p i c k e r   i s   c l o s e d 
 	 	 n u m b e r O f M o n t h s :   1 ,   / /   N u m b e r   o f   m o n t h s   t o   s h o w   a t   a   t i m e 
 	 	 s h o w C u r r e n t A t P o s :   0 ,   / /   T h e   p o s i t i o n   i n   m u l t i p e   m o n t h s   a t   w h i c h   t o   s h o w   t h e   c u r r e n t   m o n t h   ( s t a r t i n g   a t   0 ) 
 	 	 s t e p M o n t h s :   1 ,   / /   N u m b e r   o f   m o n t h s   t o   s t e p   b a c k / f o r w a r d 
 	 	 s t e p B i g M o n t h s :   1 2 ,   / /   N u m b e r   o f   m o n t h s   t o   s t e p   b a c k / f o r w a r d   f o r   t h e   b i g   l i n k s 
 	 	 a l t F i e l d :   ' ' ,   / /   S e l e c t o r   f o r   a n   a l t e r n a t e   f i e l d   t o   s t o r e   s e l e c t e d   d a t e s   i n t o 
 	 	 a l t F o r m a t :   ' ' ,   / /   T h e   d a t e   f o r m a t   t o   u s e   f o r   t h e   a l t e r n a t e   f i e l d 
 	 	 c o n s t r a i n I n p u t :   t r u e ,   / /   T h e   i n p u t   i s   c o n s t r a i n e d   b y   t h e   c u r r e n t   d a t e   f o r m a t 
 	 	 s h o w B u t t o n P a n e l :   f a l s e   / /   T r u e   t o   s h o w   b u t t o n   p a n e l ,   f a l s e   t o   n o t   s h o w   i t 
 	 } ; 
 	 $ . 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 [ ' ' ] ) ; 
 	 t h i s . d p D i v   =   $ ( ' < d i v   i d = " '   +   t h i s . _ m a i n D i v I d   +   ' "   c l a s s = " u i - d a t e p i c k e r   u i - w i d g e t   u i - w i d g e t - c o n t e n t   u i - h e l p e r - c l e a r f i x   u i - c o r n e r - a l l   u i - h e l p e r - h i d d e n - a c c e s s i b l e " > < / d i v > ' ) ; 
 } 
 
 $ . e x t e n d ( D a t e p i c k e r . 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   a   d a t e   p i c k e r .   * / 
 	 m a r k e r C l a s s N a m e :   ' h a s D a t e p i c k e r ' , 
 
 	 / *   D e b u g   l o g g i n g   ( i f   e n a b l e d ) .   * / 
 	 l o g :   f u n c t i o n   ( )   { 
 	 	 i f   ( t h i s . d e b u g ) 
 	 	 	 c o n s o l e . l o g . a p p l y ( ' ' ,   a r g u m e n 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   d a t e   p i c k e r . 
 	       @ p a r a m     s e t t i n g 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   ( a n o n y m o u s   o b j e c t ) 
 	       @ r e t u r n   t h e   m a n a g e r   o b j e c t   * / 
 	 s e t D e f a u l t s :   f u n c t i o n ( s e t t i n g 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 ,   s e t t i n g s   | |   { } ) ; 
 	 	 r e t u r n   t h i s ; 
 	 } , 
 
 	 / *   A t t a c h   t h e   d a t e   p i c k e r   t o   a   j Q u e r y   s e l e c t i o n . 
 	       @ p a r a m     t a r g e t         e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n 
 	       @ p a r a m     s e t t i n g 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 i s   d a t e   p i c k e r   i n s t a n c e   ( a n o n y m o u s )   * / 
 	 _ a t t a c h D a t e p i c k e r :   f u n c t i o n ( t a r g e t ,   s e t t i n g s )   { 
 	 	 / /   c h e c k   f o r   s e t t i n g s   o n   t h e   c o n t r o l   i t s e l f   -   i n   n a m e s p a c e   ' d a t e : ' 
 	 	 v a r   i n l i n e S e t t i n g s   =   n u l l ; 
 	 	 f o r   ( v a r   a t t r N a m e   i n   t h i s . _ d e f a u l t s )   { 
 	 	 	 v a r   a t t r V a l u e   =   t a r g e t . g e t A t t r i b u t e ( ' d a t e : '   +   a t t r N a m e ) ; 
 	 	 	 i f   ( a t t r V a l u e )   { 
 	 	 	 	 i n l i n e S e t t i n g s   =   i n l i n e S e t t i n g s   | |   { } ; 
 	 	 	 	 t r y   { 
 	 	 	 	 	 i n l i n e S e t t i n g s [ a t t r N a m e ]   =   e v a l ( a t t r V a l u e ) ; 
 	 	 	 	 }   c a t c h   ( e r r )   { 
 	 	 	 	 	 i n l i n e S e t t i n g s [ a t t r N a m e ]   =   a t t r V a l u e ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 	 v a r   n o d e N a m e   =   t a r g e t . n o d e N a m e . t o L o w e r C a s e ( ) ; 
 	 	 v a r   i n l i n e   =   ( n o d e N a m e   = =   ' d i v '   | |   n o d e N a m e   = =   ' s p a n ' ) ; 
 	 	 i f   ( ! t a r g e t . i d ) 
 	 	 	 t a r g e t . i d   =   ' d p '   +   ( + + t h i s . u u i d ) ; 
 	 	 v a r   i n s t   =   t h i s . _ n e w I n s t ( $ ( t a r g e t ) ,   i n l i n e ) ; 
 	 	 i n s t . s e t t i n g s   =   $ . e x t e n d ( { } ,   s e t t i n g s   | |   { } ,   i n l i n e S e t t i n g s   | |   { } ) ; 
 	 	 i f   ( n o d e N a m e   = =   ' i n p u t ' )   { 
 	 	 	 t h i s . _ c o n n e c t D a t e p i c k e r ( t a r g e t ,   i n s t ) ; 
 	 	 }   e l s e   i f   ( i n l i n e )   { 
 	 	 	 t h i s . _ i n l i n e D a t e p i c k e r ( t a r g e t ,   i n s t ) ; 
 	 	 } 
 	 } , 
 
 	 / *   C r e a t e   a   n e w   i n s t a n c e   o b j e c t .   * / 
 	 _ n e w I n s t :   f u n c t i o n ( t a r g e t ,   i n l i n e )   { 
 	 	 v a r   i d   =   t a r g e t [ 0 ] . i d . r e p l a c e ( / ( [ : \ [ \ ] \ . ] ) / g ,   ' \ \ \ \ $ 1 ' ) ;   / /   e s c a p e   j Q u e r y   m e t a   c h a r s 
 	 	 r e t u r n   { i d :   i d ,   i n p u t :   t a r g e t ,   / /   a s s o c i a t e d   t a r g e t 
 	 	 	 s e l e c t e d D a y :   0 ,   s e l e c t e d M o n t h :   0 ,   s e l e c t e d Y e a r :   0 ,   / /   c u r r e n t   s e l e c t i o n 
 	 	 	 d r a w M o n t h :   0 ,   d r a w Y e a r :   0 ,   / /   m o n t h   b e i n g   d r a w n 
 	 	 	 i n l i n e :   i n l i n e ,   / /   i s   d a t e p i c k e r   i n l i n e   o r   n o t 
 	 	 	 d p D i v :   ( ! i n l i n e   ?   t h i s . d p D i v   :   / /   p r e s e n t a t i o n   d i v 
 	 	 	 $ ( ' < d i v   c l a s s = " '   +   t h i s . _ i n l i n e C l a s s   +   '   u i - d a t e p i c k e r   u i - w i d g e t   u i - w i d g e t - c o n t e n t   u i - h e l p e r - c l e a r f i x   u i - c o r n e r - a l l " > < / d i v > ' ) ) } ; 
 	 } , 
 
 	 / *   A t t a c h   t h e   d a t e   p i c k e r   t o   a n   i n p u t   f i e l d .   * / 
 	 _ c o n n e c t D a t e p i c k e r :   f u n c t i o n ( t a r g e t ,   i n s t )   { 
 	 	 v a r   i n p u t   =   $ ( t a r g e t ) ; 
 	 	 i n s t . a p p e n d   =   $ ( [ ] ) ; 
 	 	 i n s t . t r i g g e r   =   $ ( [ ] ) ; 
 	 	 i f   ( i n p u 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 ; 
 	 	 v a r   a p p e n d T e x t   =   t h i s . _ g e t ( i n s t ,   ' a p p e n d T e x t ' ) ; 
 	 	 v a r   i s R T L   =   t h i s . _ g e t ( i n s t ,   ' i s R T L ' ) ; 
 	 	 i f   ( a p p e n d T e x t )   { 
 	 	 	 i n s t . a p p e n d   =   $ ( ' < s p a n   c l a s s = " '   +   t h i s . _ a p p e n d C l a s s   +   ' " > '   +   a p p e n d T e x t   +   ' < / s p a n > ' ) ; 
 	 	 	 i n p u t [ i s R T L   ?   ' b e f o r e '   :   ' a f t e r ' ] ( i n s t . a p p e n d ) ; 
 	 	 } 
 	 	 v a r   s h o w O n   =   t h i s . _ g e t ( i n s t ,   ' s h o w O n ' ) ; 
 	 	 i f   ( s h o w O n   = =   ' f o c u s '   | |   s h o w O n   = =   ' b o t h ' )   / /   p o p - u p   d a t e   p i c k e r   w h e n   i n   t h e   m a r k e d   f i e l d 
 	 	 	 i n p u t . f o c u s ( t h i s . _ s h o w D a t e p i c k e r ) ; 
 	 	 i f   ( s h o w O n   = =   ' b u t t o n '   | |   s h o w O n   = =   ' b o t h ' )   {   / /   p o p - u p   d a t e   p i c k e r   w h e n   b u t t o n   c l i c k e d 
 	 	 	 v a r   b u t t o n T e x t   =   t h i s . _ g e t ( i n s t ,   ' b u t t o n T e x t ' ) ; 
 	 	 	 v a r   b u t t o n I m a g e   =   t h i s . _ g e t ( i n s t ,   ' b u t t o n I m a g e ' ) ; 
 	 	 	 i n s t . t r i g g e r   =   $ ( t h i s . _ g e t ( i n s t ,   ' b u t t o n I m a g e O n l y ' )   ? 
 	 	 	 	 $ ( ' < i m g / > ' ) . a d d C l a s s ( t h i s . _ t r i g g e r C l a s s ) . 
 	 	 	 	 	 a t t r ( {   s r c :   b u t t o n I m a g e ,   a l t :   b u t t o n T e x t ,   t i t l e :   b u t t o n T e x t   } )   : 
 	 	 	 	 $ ( ' < b u t t o n   t y p e = " b u t t o n " > < / b u t t o n > ' ) . a d d C l a s s ( t h i s . _ t r i g g e r C l a s s ) . 
 	 	 	 	 	 h t m l ( b u t t o n I m a g e   = =   ' '   ?   b u t t o n T e x t   :   $ ( ' < i m g / > ' ) . a t t r ( 
 	 	 	 	 	 {   s r c : b u t t o n I m a g e ,   a l t : b u t t o n T e x t ,   t i t l e : b u t t o n T e x t   } ) ) ) ; 
 	 	 	 i n p u t [ i s R T L   ?   ' b e f o r e '   :   ' a f t e r ' ] ( i n s t . t r i g g e r ) ; 
 	 	 	 i n s t . t r i g g e r . c l i c k ( f u n c t i o n ( )   { 
 	 	 	 	 i f   ( $ . d a t e p i c k e r . _ d a t e p i c k e r S h o w i n g   & &   $ . d a t e p i c k e r . _ l a s t I n p u t   = =   t a r g e t ) 
 	 	 	 	 	 $ . d a t e p i c k e r . _ h i d e D a t e p i c k e r ( ) ; 
 	 	 	 	 e l s e 
 	 	 	 	 	 $ . d a t e p i c k e r . _ s h o w D a t e p i c k e r ( t a r g e t ) ; 
 	 	 	 	 r e t u r n   f a l s e ; 
 	 	 	 } ) ; 
 	 	 } 
 	 	 i n p u 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 ) . k e y d o w n ( t h i s . _ d o K e y D o w n ) . k e y p r e s s ( t h i s . _ d o K e y P r e s s ) . 
 	 	 	 b i n d ( " s e t D a t a . d a t e p i c k e r " ,   f u n c t i o n ( e v e n t ,   k e y ,   v a l u e )   { 
 	 	 	 	 i n s t . s e t t i n g s [ k e y ]   =   v a l u e ; 
 	 	 	 } ) . b i n d ( " g e t D a t a . d a t e p i c k e r " ,   f u n c t i o n ( e v e n t ,   k e y )   { 
 	 	 	 	 r e t u r n   t h i s . _ g e t ( i n s t ,   k e y ) ; 
 	 	 	 } ) ; 
 	 	 $ . d a t a ( t a r g e t ,   P R O P _ N A M E ,   i n s t ) ; 
 	 } , 
 
 	 / *   A t t a c h   a n   i n l i n e   d a t e   p i c k e r   t o   a   d i v .   * / 
 	 _ i n l i n e D a t e p i c k e r :   f u n c t i o n ( t a r g e t ,   i n s t )   { 
 	 	 v a r   d i v S p a n   =   $ ( t a r g e t ) ; 
 	 	 i f   ( d i v S p a n . 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 ; 
 	 	 d i v S p a n . 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 ) . a p p e n d ( i n s t . d p D i v ) . 
 	 	 	 b i n d ( " s e t D a t a . d a t e p i c k e r " ,   f u n c t i o n ( e v e n t ,   k e y ,   v a l u e ) { 
 	 	 	 	 i n s t . s e t t i n g s [ k e y ]   =   v a l u e ; 
 	 	 	 } ) . b i n d ( " g e t D a t a . d a t e p i c k e r " ,   f u n c t i o n ( e v e n t ,   k e y ) { 
 	 	 	 	 r e t u r n   t h i s . _ g e t ( i n s t ,   k e y ) ; 
 	 	 	 } ) ; 
 	 	 $ . 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 . _ s e t D a t e ( i n s t ,   t h i s . _ g e t D e f a u l t D a t e ( i n s t ) ) ; 
 	 	 t h i s . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 	 t h i s . _ u p d a t e A l t e r n a t e ( i n s t ) ; 
 	 } , 
 
 	 / *   P o p - u p   t h e   d a t e   p i c k e r   i n   a   " d i a l o g "   b o x . 
 	       @ p a r a m     i n p u t           e l e m e n t   -   i g n o r e d 
 	       @ p a r a m     d a t e T e x t     s t r i n g   -   t h e   i n i t i a l   d a t e   t o   d i s p l a y   ( i n   t h e   c u r r e n t   f o r m a t ) 
 	       @ p a r a m     o n S e l e c t     f u n c t i o n   -   t h e   f u n c t i o n ( d a t e T e x t )   t o   c a l l   w h e n   a   d a t e   i s   s e l e c t e d 
 	       @ p a r a m     s e t t i n g s     o b j e c t   -   u p d a t e   t h e   d i a l o g   d a t e   p i c k e r   i n s t a n c e ' s   s e t t i n g s   ( a n o n y m o u s   o b j e c t ) 
 	       @ p a r a m     p o s               i n t [ 2 ]   -   c o o r d i n a t e s   f o r   t h e   d i a l o g ' s   p o s i t i o n   w i t h i n   t h e   s c r e e n   o r 
 	                                           e v e n t   -   w i t h   x / y   c o o r d i n a t e s   o r 
 	                                           l e a v e   e m p t y   f o r   d e f a u l t   ( s c r e e n   c e n t r e ) 
 	       @ r e t u r n   t h e   m a n a g e r   o b j e c t   * / 
 	 _ d i a l o g D a t e p i c k e r :   f u n c t i o n ( i n p u t ,   d a t e T e x t ,   o n S e l e c t ,   s e t t i n g s ,   p o s )   { 
 	 	 v a r   i n s t   =   t h i s . _ d i a l o g I n s t ;   / /   i n t e r n a l   i n s t a n c e 
 	 	 i f   ( ! i n s t )   { 
 	 	 	 v a r   i d   =   ' d p '   +   ( + + t h i s . u u i d ) ; 
 	 	 	 t h i s . _ d i a l o g I n p u t   =   $ ( ' < i n p u t   t y p e = " t e x t "   i d = " '   +   i d   + 
 	 	 	 	 ' "   s i z e = " 1 "   s t y l e = " p o s i t i o n :   a b s o l u t e ;   t o p :   - 1 0 0 p x ; " / > ' ) ; 
 	 	 	 t h i s . _ d i a l o g I n p u t . k e y d o w n ( t h i s . _ d o K e y D o w n ) ; 
 	 	 	 $ ( ' b o d y ' ) . a p p e n d ( t h i s . _ d i a l o g I n p u t ) ; 
 	 	 	 i n s t   =   t h i s . _ d i a l o g I n s t   =   t h i s . _ n e w I n s t ( t h i s . _ d i a l o g I n p u t ,   f a l s e ) ; 
 	 	 	 i n s t . s e t t i n g s   =   { } ; 
 	 	 	 $ . d a t a ( t h i s . _ d i a l o g I n p u t [ 0 ] ,   P R O P _ N A M E ,   i n s t ) ; 
 	 	 } 
 	 	 e x t e n d R e m o v e ( i n s t . s e t t i n g s ,   s e t t i n g s   | |   { } ) ; 
 	 	 t h i s . _ d i a l o g I n p u t . v a l ( d a t e T e x t ) ; 
 
 	 	 t h i s . _ p o s   =   ( p o s   ?   ( p o s . l e n g t h   ?   p o s   :   [ p o s . p a g e X ,   p o s . p a g e Y ] )   :   n u l l ) ; 
 	 	 i f   ( ! t h i s . _ p o s )   { 
 	 	 	 v a r   b r o w s e r W i d t h   =   w i n d o w . i n n e r W i d t h   | |   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t W i d t h   | | 	 d o c u m e n t . b o d y . c l i e n t W i d t h ; 
 	 	 	 v a r   b r o w s e r H e i g h t   =   w i n d o w . i n n e r H e i g h t   | |   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t H e i g h t   | |   d o c u m e n t . b o d y . c l i e n t H e i g h t ; 
 	 	 	 v a r   s c r o l l X   =   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t   | |   d o c u m e n t . b o d y . s c r o l l L e f t ; 
 	 	 	 v a r   s c r o l l Y   =   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p   | |   d o c u m e n t . b o d y . s c r o l l T o p ; 
 	 	 	 t h i s . _ p o s   =   / /   s h o u l d   u s e   a c t u a l   w i d t h / h e i g h t   b e l o w 
 	 	 	 	 [ ( b r o w s e r W i d t h   /   2 )   -   1 0 0   +   s c r o l l X ,   ( b r o w s e r H e i g h t   /   2 )   -   1 5 0   +   s c r o l l Y ] ; 
 	 	 } 
 
 	 	 / /   m o v e   i n p u t   o n   s c r e e n   f o r   f o c u s ,   b u t   h i d d e n   b e h i n d   d i a l o g 
 	 	 t h i s . _ d i a l o g I n p u t . c s s ( ' l e f t ' ,   t h i s . _ p o s [ 0 ]   +   ' p x ' ) . c s s ( ' t o p ' ,   t h i s . _ p o s [ 1 ]   +   ' p x ' ) ; 
 	 	 i n s t . s e t t i n g s . o n S e l e c t   =   o n S e l e c t ; 
 	 	 t h i s . _ i n D i a l o g   =   t r u e ; 
 	 	 t h i s . d p D i v . a d d C l a s s ( t h i s . _ d i a l o g C l a s s ) ; 
 	 	 t h i s . _ s h o w D a t e p i c k e r ( t h i s . _ d i a l o g I n p u t [ 0 ] ) ; 
 	 	 i f   ( $ . b l o c k U I ) 
 	 	 	 $ . b l o c k U I ( t h i s . d p D i v ) ; 
 	 	 $ . d a t a ( t h i s . _ d i a l o g I n p u t [ 0 ] ,   P R O P _ N A M E ,   i n s t ) ; 
 	 	 r e t u r n   t h i s ; 
 	 } , 
 
 	 / *   D e t a c h   a   d a t e p i c k e r   f r o m   i t s   c o n t r o l . 
 	       @ p a r a m     t a r g e t         e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n   * / 
 	 _ d e s t r o y D a t e p i c k e r :   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 ) ; 
 	 	 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   ( ! $ 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 ; 
 	 	 } 
 	 	 v a r   n o d e N a m e   =   t a r g e t . n o d e N a m e . t o L o w e r C a s e ( ) ; 
 	 	 $ . r e m o v e D a t a ( t a r g e t ,   P R O P _ N A M E ) ; 
 	 	 i f   ( n o d e N a m e   = =   ' i n p u t ' )   { 
 	 	 	 i n s t . a p p e n d . r e m o v e ( ) ; 
 	 	 	 i n s t . t r i g g e r . r e m o v e ( ) ; 
 	 	 	 $ 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 ) . 
 	 	 	 	 u n b i n d ( ' f o c u s ' ,   t h i s . _ s h o w D a t e p i c k e r ) . 
 	 	 	 	 u n b i n d ( ' k e y d o w n ' ,   t h i s . _ d o K e y D o w n ) . 
 	 	 	 	 u n b i n d ( ' k e y p r e s s ' ,   t h i s . _ d o K e y P r e s s ) ; 
 	 	 }   e l s e   i f   ( n o d e N a m e   = =   ' d i v '   | |   n o d e N a m e   = =   ' s p a n ' ) 
 	 	 	 $ 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 ( ) ; 
 	 } , 
 
 	 / *   E n a b l e   t h e   d a t e   p i c k e r   t o   a   j Q u e r y   s e l e c t i o n . 
 	       @ p a r a m     t a r g e t         e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n   * / 
 	 _ e n a b l e D a t e p i c k e r :   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 ) ; 
 	 	 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   ( ! $ 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 ; 
 	 	 } 
 	 	 v a r   n o d e N a m e   =   t a r g e t . n o d e N a m e . t o L o w e r C a s e ( ) ; 
 	 	 i f   ( n o d e N a m e   = =   ' i n p u t ' )   { 
 	 	 	 t a r g e t . d i s a b l e d   =   f a l s e ; 
 	 	 	 i n s t . t r i g g e r . f i l t e r ( ' b u t t o n ' ) . 
 	 	 	 	 e a c h ( f u n c t i o n ( )   {   t h i s . d i s a b l e d   =   f a l s e ;   } ) . e n d ( ) . 
 	 	 	 	 f i l t e r ( ' i m g ' ) . c s s ( { o p a c i t y :   ' 1 . 0 ' ,   c u r s o r :   ' ' } ) ; 
 	 	 } 
 	 	 e l s e   i f   ( n o d e N a m e   = =   ' d i v '   | |   n o d e N a m e   = =   ' s p a n ' )   { 
 	 	 	 v a r   i n l i n e   =   $ t a r g e t . c h i l d r e n ( ' . '   +   t h i s . _ i n l i n e C l a s s ) ; 
 	 	 	 i n l i n e . c h i l d r e n ( ) . r e m o v e C l a s s ( ' u i - s t a t e - d i s a b l e d ' ) ; 
 	 	 } 
 	 	 t h i s . _ d i s a b l e d I n p u t s   =   $ . m a p ( t h i s . _ d i s a b l e d I n p u 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 
 	 } , 
 
 	 / *   D i s a b l e   t h e   d a t e   p i c k e r   t o   a   j Q u e r y   s e l e c t i o n . 
 	       @ p a r a m     t a r g e t         e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n   * / 
 	 _ d i s a b l e D a t e p i c k e r :   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 ) ; 
 	 	 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   ( ! $ 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 ; 
 	 	 } 
 	 	 v a r   n o d e N a m e   =   t a r g e t . n o d e N a m e . t o L o w e r C a s e ( ) ; 
 	 	 i f   ( n o d e N a m e   = =   ' i n p u t ' )   { 
 	 	 	 t a r g e t . d i s a b l e d   =   t r u e ; 
 	 	 	 i n s t . t r i g g e r . f i l t e r ( ' b u t t o n ' ) . 
 	 	 	 	 e a c h ( f u n c t i o n ( )   {   t h i s . d i s a b l e d   =   t r u e ;   } ) . e n d ( ) . 
 	 	 	 	 f i l t e r ( ' i m g ' ) . c s s ( { o p a c i t y :   ' 0 . 5 ' ,   c u r s o r :   ' d e f a u l t ' } ) ; 
 	 	 } 
 	 	 e l s e   i f   ( n o d e N a m e   = =   ' d i v '   | |   n o d e N a m e   = =   ' s p a n ' )   { 
 	 	 	 v a r   i n l i n e   =   $ t a r g e t . c h i l d r e n ( ' . '   +   t h i s . _ i n l i n e C l a s s ) ; 
 	 	 	 i n l i n e . c h i l d r e n ( ) . a d d C l a s s ( ' u i - s t a t e - d i s a b l e d ' ) ; 
 	 	 } 
 	 	 t h i s . _ d i s a b l e d I n p u t s   =   $ . m a p ( t h i s . _ d i s a b l e d I n p u 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 
 	 	 t h i s . _ d i s a b l e d I n p u t s [ t h i s . _ d i s a b l e d I n p u t s . l e n g t h ]   =   t a r g e t ; 
 	 } , 
 
 	 / *   I s   t h e   f i r s t   f i e l d   i n   a   j Q u e r y   c o l l e c t i o n   d i s a b l e d   a s   a   d a t e p i c k e r ? 
 	       @ p a r a m     t a r g e t         e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n 
 	       @ r e t u r n   b o o l e a n   -   t r u e   i f   d i s a b l e d ,   f a l s e   i f   e n a b l e d   * / 
 	 _ i s D i s a b l e d D a t e p i c k e r :   f u n c t i o n ( t a r g e t )   { 
 	 	 i f   ( ! t a r g e t )   { 
 	 	 	 r e t u r n   f a l s e ; 
 	 	 } 
 	 	 f o r   ( v a r   i   =   0 ;   i   <   t h i s . _ d i s a b l e d I n p u t s . l e n g t h ;   i + + )   { 
 	 	 	 i f   ( t h i s . _ d i s a b l e d I n p u t s [ i ]   = =   t a r g e t ) 
 	 	 	 	 r e t u r n   t r u e ; 
 	 	 } 
 	 	 r e t u r n   f a l s e ; 
 	 } , 
 
 	 / *   R e t r i e v e   t h e   i n s t a n c e   d a t a   f o r   t h e   t a r g e t   c o n t r o l . 
 	       @ p a r a m     t a r g e t     e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n 
 	       @ r e t u r n     o b j e c t   -   t h e   a s s o c i a t e d   i n s t a n c e   d a t a 
 	       @ t h r o w s     e r r o r   i f   a   j Q u e r y   p r o b l e m   g e t t i n g   d a t a   * / 
 	 _ g e t I n s t :   f u n c t i o n ( t a r g e t )   { 
 	 	 t r y   { 
 	 	 	 r e t u r n   $ . d a t a ( t a r g e t ,   P R O P _ N A M E ) ; 
 	 	 } 
 	 	 c a t c h   ( e r r )   { 
 	 	 	 t h r o w   ' M i s s i n g   i n s t a n c e   d a t a   f o r   t h i s   d a t e p i c k e r ' ; 
 	 	 } 
 	 } , 
 
 	 / *   U p d a t e   t h e   s e t t i n g s   f o r   a   d a t e   p i c k e r   a t t a c h e d   t o   a n   i n p u t   f i e l d   o r   d i v i s i o n . 
 	       @ p a r a m     t a r g e t     e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n 
 	       @ p a r a m     n a m e         o b j e c t   -   t h e   n e w   s e t t i n g s   t o   u p d a t e   o r 
 	                                       s t r i n g   -   t h e   n a m e   o f   t h e   s e t t i n g   t o   c h a n g e   o r 
 	       @ p a r a m     v a l u e       a n y   -   t h e   n e w   v a l u e   f o r   t h e   s e t t i n g   ( o m i t   i f   a b o v e   i s   a n   o b j e c t )   * / 
 	 _ o p t i o n D a t e p i c k e r :   f u n c t i o n ( t a r g e t ,   n a m e ,   v a l u e )   { 
 	 	 v a r   s e t t i n g s   =   n a m e   | |   { } ; 
 	 	 i f   ( t y p e o f   n a m e   = =   ' s t r i n g ' )   { 
 	 	 	 s e t t i n g s   =   { } ; 
 	 	 	 s e t t i n g s [ n a m e ]   =   v a l u e ; 
 	 	 } 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t ) ; 
 	 	 i f   ( i n s t )   { 
 	 	 	 i f   ( t h i s . _ c u r I n s t   = =   i n s t )   { 
 	 	 	 	 t h i s . _ h i d e D a t e p i c k e r ( n u l l ) ; 
 	 	 	 } 
 	 	 	 e x t e n d R e m o v e ( i n s t . s e t t i n g s ,   s e t t i n g s ) ; 
 	 	 	 v a r   d a t e   =   n e w   D a t e ( ) ; 
 	 	 	 e x t e n d R e m o v e ( i n s t ,   { r a n g e S t a r t :   n u l l ,   / /   s t a r t   o f   r a n g e 
 	 	 	 	 e n d D a y :   n u l l ,   e n d M o n t h :   n u l l ,   e n d Y e a r :   n u l l ,   / /   e n d   o f   r a n g e 
 	 	 	 	 s e l e c t e d D a y :   d a t e . g e t D a t e ( ) ,   s e l e c t e d M o n t h :   d a t e . g e t M o n t h ( ) , 
 	 	 	 	 s e l e c t e d Y e a r :   d a t e . g e t F u l l Y e a r ( ) ,   / /   s t a r t i n g   p o i n t 
 	 	 	 	 c u r r e n t D a y :   d a t e . g e t D a t e ( ) ,   c u r r e n t M o n t h :   d a t e . g e t M o n t h ( ) , 
 	 	 	 	 c u r r e n t Y e a r :   d a t e . g e t F u l l Y e a r ( ) ,   / /   c u r r e n t   s e l e c t i o n 
 	 	 	 	 d r a w M o n t h :   d a t e . g e t M o n t h ( ) ,   d r a w Y e a r :   d a t e . g e t F u l l Y e a r ( ) } ) ;   / /   m o n t h   b e i n g   d r a w n 
 	 	 	 t h i s . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 	 } 
 	 } , 
 
 	 / /   c h a n g e   m e t h o d   d e p r e c a t e d 
 	 _ c h a n g e D a t e p i c k e r :   f u n c t i o n ( t a r g e t ,   n a m e ,   v a l u e )   { 
 	 	 t h i s . _ o p t i o n D a t e p i c k e r ( t a r g e t ,   n a m e ,   v a l u e ) ; 
 	 } , 
 
 	 / *   R e d r a w   t h e   d a t e   p i c k e r   a t t a c h e d   t o   a n   i n p u t   f i e l d   o r   d i v i s i o n . 
 	       @ p a r a m     t a r g e t     e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n   * / 
 	 _ r e f r e s h D a t e p i c k e r :   f u n c t i o n ( t a r g e t )   { 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t ) ; 
 	 	 i f   ( i n s t )   { 
 	 	 	 t h i s . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 	 } 
 	 } , 
 
 	 / *   S e t   t h e   d a t e s   f o r   a   j Q u e r y   s e l e c t i o n . 
 	       @ p a r a m     t a r g e t       e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n 
 	       @ p a r a m     d a t e           D a t e   -   t h e   n e w   d a t e 
 	       @ p a r a m     e n d D a t e     D a t e   -   t h e   n e w   e n d   d a t e   f o r   a   r a n g e   ( o p t i o n a l )   * / 
 	 _ s e t D a t e D a t e p i c k e r :   f u n c t i o n ( t a r g e t ,   d a t e ,   e n d D a t e )   { 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t ) ; 
 	 	 i f   ( i n s t )   { 
 	 	 	 t h i s . _ s e t D a t e ( i n s t ,   d a t e ,   e n d D a t e ) ; 
 	 	 	 t h i s . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 	 	 t h i s . _ u p d a t e A l t e r n a t e ( i n s t ) ; 
 	 	 } 
 	 } , 
 
 	 / *   G e t   t h e   d a t e ( s )   f o r   t h e   f i r s t   e n t r y   i n   a   j Q u e r y   s e l e c t i o n . 
 	       @ p a r a m     t a r g e t     e l e m e n t   -   t h e   t a r g e t   i n p u t   f i e l d   o r   d i v i s i o n   o r   s p a n 
 	       @ r e t u r n   D a t e   -   t h e   c u r r e n t   d a t e   o r 
 	                       D a t e [ 2 ]   -   t h e   c u r r e n t   d a t e s   f o r   a   r a n g e   * / 
 	 _ g e t D a t e D a t e p i c k e r :   f u n c t i o n ( t a r g e t )   { 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t ) ; 
 	 	 i f   ( i n s t   & &   ! i n s t . i n l i n e ) 
 	 	 	 t h i s . _ s e t D a t e F r o m F i e l d ( i n s t ) ; 
 	 	 r e t u r n   ( i n s t   ?   t h i s . _ g e t D a t e ( i n s t )   :   n u l l ) ; 
 	 } , 
 
 	 / *   H a n d l e   k e y s t r o k e s .   * / 
 	 _ d o K e y D o w n :   f u n c t i o n ( e v e n t )   { 
 	 	 v a r   i n s t   =   $ . d a t e p i c k e r . _ g e t I n s t ( e v e n t . t a r g e t ) ; 
 	 	 v a r   h a n d l e d   =   t r u e ; 
 	 	 v a r   i s R T L   =   i n s t . d p D i v . i s ( ' . u i - d a t e p i c k e r - r t l ' ) ; 
 	 	 i n s t . _ k e y E v e n t   =   t r u e ; 
 	 	 i f   ( $ . d a t e p i c k e r . _ d a t e p i c k e r S h o w i n g ) 
 	 	 	 s w i t c h   ( e v e n t . k e y C o d e )   { 
 	 	 	 	 c a s e   9 :     $ . d a t e p i c k e r . _ h i d e D a t e p i c k e r ( n u l l ,   ' ' ) ; 
 	 	 	 	 	 	 b r e a k ;   / /   h i d e   o n   t a b   o u t 
 	 	 	 	 c a s e   1 3 :   v a r   s e l   =   $ ( ' t d . '   +   $ . d a t e p i c k e r . _ d a y O v e r C l a s s   + 
 	 	 	 	 	 	 	 ' ,   t d . '   +   $ . d a t e p i c k e r . _ c u r r e n t C l a s s ,   i n s t . d p D i v ) ; 
 	 	 	 	 	 	 i f   ( s e l [ 0 ] ) 
 	 	 	 	 	 	 	 $ . d a t e p i c k e r . _ s e l e c t D a y ( e v e n t . t a r g e t ,   i n s t . s e l e c t e d M o n t h ,   i n s t . s e l e c t e d Y e a r ,   s e l [ 0 ] ) ; 
 	 	 	 	 	 	 e l s e 
 	 	 	 	 	 	 	 $ . d a t e p i c k e r . _ h i d e D a t e p i c k e r ( n u l l ,   $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' d u r a t i o n ' ) ) ; 
 	 	 	 	 	 	 r e t u r n   f a l s e ;   / /   d o n ' t   s u b m i t   t h e   f o r m 
 	 	 	 	 	 	 b r e a k ;   / /   s e l e c t   t h e   v a l u e   o n   e n t e r 
 	 	 	 	 c a s e   2 7 :   $ . d a t e p i c k e r . _ h i d e D a t e p i c k e r ( n u l l ,   $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' d u r a t i o n ' ) ) ; 
 	 	 	 	 	 	 b r e a k ;   / /   h i d e   o n   e s c a p e 
 	 	 	 	 c a s e   3 3 :   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ? 
 	 	 	 	 	 	 	 - $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p B i g M o n t h s ' )   : 
 	 	 	 	 	 	 	 - $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p M o n t h s ' ) ) ,   ' M ' ) ; 
 	 	 	 	 	 	 b r e a k ;   / /   p r e v i o u s   m o n t h / y e a r   o n   p a g e   u p / +   c t r l 
 	 	 	 	 c a s e   3 4 :   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ? 
 	 	 	 	 	 	 	 + $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p B i g M o n t h s ' )   : 
 	 	 	 	 	 	 	 + $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p M o n t h s ' ) ) ,   ' M ' ) ; 
 	 	 	 	 	 	 b r e a k ;   / /   n e x t   m o n t h / y e a r   o n   p a g e   d o w n / +   c t r l 
 	 	 	 	 c a s e   3 5 :   i f   ( e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y )   $ . d a t e p i c k e r . _ c l e a r D a t e ( e v e n t . t a r g e t ) ; 
 	 	 	 	 	 	 h a n d l e d   =   e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y ; 
 	 	 	 	 	 	 b r e a k ;   / /   c l e a r   o n   c t r l   o r   c o m m a n d   + e n d 
 	 	 	 	 c a s e   3 6 :   i f   ( e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y )   $ . d a t e p i c k e r . _ g o t o T o d a y ( e v e n t . t a r g e t ) ; 
 	 	 	 	 	 	 h a n d l e d   =   e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y ; 
 	 	 	 	 	 	 b r e a k ;   / /   c u r r e n t   o n   c t r l   o r   c o m m a n d   + h o m e 
 	 	 	 	 c a s e   3 7 :   i f   ( e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y )   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   ( i s R T L   ?   + 1   :   - 1 ) ,   ' D ' ) ; 
 	 	 	 	 	 	 h a n d l e d   =   e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y ; 
 	 	 	 	 	 	 / /   - 1   d a y   o n   c t r l   o r   c o m m a n d   + l e f t 
 	 	 	 	 	 	 i f   ( e v e n t . o r i g i n a l E v e n t . a l t K e y )   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ? 
 	 	 	 	 	 	 	 	 	 - $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p B i g M o n t h s ' )   : 
 	 	 	 	 	 	 	 	 	 - $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p M o n t h s ' ) ) ,   ' M ' ) ; 
 	 	 	 	 	 	 / /   n e x t   m o n t h / y e a r   o n   a l t   + l e f t   o n   M a c 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 c a s e   3 8 :   i f   ( e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y )   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   - 7 ,   ' D ' ) ; 
 	 	 	 	 	 	 h a n d l e d   =   e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y ; 
 	 	 	 	 	 	 b r e a k ;   / /   - 1   w e e k   o n   c t r l   o r   c o m m a n d   + u p 
 	 	 	 	 c a s e   3 9 :   i f   ( e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y )   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   ( i s R T L   ?   - 1   :   + 1 ) ,   ' D ' ) ; 
 	 	 	 	 	 	 h a n d l e d   =   e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y ; 
 	 	 	 	 	 	 / /   + 1   d a y   o n   c t r l   o r   c o m m a n d   + r i g h t 
 	 	 	 	 	 	 i f   ( e v e n t . o r i g i n a l E v e n t . a l t K e y )   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ? 
 	 	 	 	 	 	 	 	 	 + $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p B i g M o n t h s ' )   : 
 	 	 	 	 	 	 	 	 	 + $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s t e p M o n t h s ' ) ) ,   ' M ' ) ; 
 	 	 	 	 	 	 / /   n e x t   m o n t h / y e a r   o n   a l t   + r i g h t 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 c a s e   4 0 :   i f   ( e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y )   $ . d a t e p i c k e r . _ a d j u s t D a t e ( e v e n t . t a r g e t ,   + 7 ,   ' D ' ) ; 
 	 	 	 	 	 	 h a n d l e d   =   e v e n t . c t r l K e y   | |   e v e n t . m e t a K e y ; 
 	 	 	 	 	 	 b r e a k ;   / /   + 1   w e e k   o n   c t r l   o r   c o m m a n d   + d o w n 
 	 	 	 	 d e f a u l t :   h a n d l e d   =   f a l s e ; 
 	 	 	 } 
 	 	 e l s e   i f   ( e v e n t . k e y C o d e   = =   3 6   & &   e v e n t . c t r l K e y )   / /   d i s p l a y   t h e   d a t e   p i c k e r   o n   c t r l + h o m e 
 	 	 	 $ . d a t e p i c k e r . _ s h o w D a t e p i c k e r ( t h i s ) ; 
 	 	 e l s e   { 
 	 	 	 h a n d l e d   =   f a l s e ; 
 	 	 } 
 	 	 i f   ( h a n d l e d )   { 
 	 	 	 e v e n t . p r e v e n t D e f a u l t ( ) ; 
 	 	 	 e v e n t . s t o p P r o p a g a t i o n ( ) ; 
 	 	 } 
 	 } , 
 
 	 / *   F i l t e r   e n t e r e d   c h a r a c t e r s   -   b a s e d   o n   d a t e   f o r m a t .   * / 
 	 _ d o K e y P r e s s :   f u n c t i o n ( e v e n t )   { 
 	 	 v a r   i n s t   =   $ . d a t e p i c k e r . _ g e t I n s t ( e v e n t . t a r g e t ) ; 
 	 	 i f   ( $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' c o n s t r a i n I n p u t ' ) )   { 
 	 	 	 v a r   c h a r s   =   $ . d a t e p i c k e r . _ p o s s i b l e C h a r s ( $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' d a t e F o r m a t ' ) ) ; 
 	 	 	 v a r   c h r   =   S t r i n g . f r o m C h a r C o d e ( e v e n t . c h a r C o d e   = =   u n d e f i n e d   ?   e v e n t . k e y C o d e   :   e v e n t . c h a r C o d e ) ; 
 	 	 	 r e t u r n   e v e n t . c t r l K e y   | |   ( c h r   <   '   '   | |   ! c h a r s   | |   c h a r s . i n d e x O f ( c h r )   >   - 1 ) ; 
 	 	 } 
 	 } , 
 
 	 / *   P o p - u p   t h e   d a t e   p i c k e r   f o r   a   g i v e n   i n p u t   f i e l d . 
 	       @ p a r a m     i n p u t     e l e m e n t   -   t h e   i n p u t   f i e l d   a t t a c h e d   t o   t h e   d a t e   p i c k e r   o r 
 	                                     e v e n t   -   i f   t r i g g e r e d   b y   f o c u s   * / 
 	 _ s h o w D a t e p i c k e r :   f u n c t i o n ( i n p u t )   { 
 	 	 i n p u t   =   i n p u t . t a r g e t   | |   i n p u t ; 
 	 	 i f   ( i n p u t . n o d e N a m e . t o L o w e r C a s e ( )   ! =   ' i n p u t ' )   / /   f i n d   f r o m   b u t t o n / i m a g e   t r i g g e r 
 	 	 	 i n p u t   =   $ ( ' i n p u t ' ,   i n p u t . p a r e n t N o d e ) [ 0 ] ; 
 	 	 i f   ( $ . d a t e p i c k e r . _ i s D i s a b l e d D a t e p i c k e r ( i n p u t )   | |   $ . d a t e p i c k e r . _ l a s t I n p u t   = =   i n p u t )   / /   a l r e a d y   h e r e 
 	 	 	 r e t u r n ; 
 	 	 v a r   i n s t   =   $ . d a t e p i c k e r . _ g e t I n s t ( i n p u t ) ; 
 	 	 v a r   b e f o r e S h o w   =   $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' b e f o r e S h o w ' ) ; 
 	 	 e x t e n d R e m o v e ( i n s t . s e t t i n g s ,   ( b e f o r e S h o w   ?   b e f o r e S h o w . a p p l y ( i n p u t ,   [ i n p u t ,   i n s t ] )   :   { } ) ) ; 
 	 	 $ . d a t e p i c k e r . _ h i d e D a t e p i c k e r ( n u l l ,   ' ' ) ; 
 	 	 $ . d a t e p i c k e r . _ l a s t I n p u t   =   i n p u t ; 
 	 	 $ . d a t e p i c k e r . _ s e t D a t e F r o m F i e l d ( i n s t ) ; 
 	 	 i f   ( $ . d a t e p i c k e r . _ i n D i a l o g )   / /   h i d e   c u r s o r 
 	 	 	 i n p u t . v a l u e   =   ' ' ; 
 	 	 i f   ( ! $ . d a t e p i c k e r . _ p o s )   {   / /   p o s i t i o n   b e l o w   i n p u t 
 	 	 	 $ . d a t e p i c k e r . _ p o s   =   $ . d a t e p i c k e r . _ f i n d P o s ( i n p u t ) ; 
 	 	 	 $ . d a t e p i c k e r . _ p o s [ 1 ]   + =   i n p u t . o f f s e t H e i g h t ;   / /   a d d   t h e   h e i g h t 
 	 	 } 
 	 	 v a r   i s F i x e d   =   f a l s e ; 
 	 	 $ ( i n p u t ) . p a r e n t s ( ) . e a c h ( f u n c t i o n ( )   { 
 	 	 	 i s F i x e d   | =   $ ( t h i s ) . c s s ( ' p o s i t i o n ' )   = =   ' f i x e d ' ; 
 	 	 	 r e t u r n   ! i s F i x e d ; 
 	 	 } ) ; 
 	 	 i f   ( i s F i x e d   & &   $ . b r o w s e r . o p e r a )   {   / /   c o r r e c t i o n   f o r   O p e r a   w h e n   f i x e d   a n d   s c r o l l e d 
 	 	 	 $ . d a t e p i c k e r . _ p o s [ 0 ]   - =   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t ; 
 	 	 	 $ . d a t e p i c k e r . _ p o s [ 1 ]   - =   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p ; 
 	 	 } 
 	 	 v a r   o f f s e t   =   { l e f t :   $ . d a t e p i c k e r . _ p o s [ 0 ] ,   t o p :   $ . d a t e p i c k e r . _ p o s [ 1 ] } ; 
 	 	 $ . d a t e p i c k e r . _ p o s   =   n u l l ; 
 	 	 i n s t . r a n g e S t a r t   =   n u l l ; 
 	 	 / /   d e t e r m i n e   s i z i n g   o f f s c r e e n 
 	 	 i n s t . d p D i v . c s s ( { p o s i t i o n :   ' a b s o l u t e ' ,   d i s p l a y :   ' b l o c k ' ,   t o p :   ' - 1 0 0 0 p x ' } ) ; 
 	 	 $ . d a t e p i c k e r . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 	 / /   f i x   w i d t h   f o r   d y n a m i c   n u m b e r   o f   d a t e   p i c k e r s 
 	 	 / /   a n d   a d j u s t   p o s i t i o n   b e f o r e   s h o w i n g 
 	 	 o f f s e t   =   $ . d a t e p i c k e r . _ c h e c k O f f s e t ( i n s t ,   o f f s e t ,   i s F i x e d ) ; 
 	 	 i n s t . d p D i v . c s s ( { p o s i t i o n :   ( $ . d a t e p i c k e r . _ i n D i a l o g   & &   $ . b l o c k U I   ? 
 	 	 	 ' s t a t i c '   :   ( i s F i x e d   ?   ' f i x e d '   :   ' a b s o l u t e ' ) ) ,   d i s p l a y :   ' n o n e ' , 
 	 	 	 l e f t :   o f f s e t . l e f t   +   ' p x ' ,   t o p :   o f f s e t . t o p   +   ' p x ' } ) ; 
 	 	 i f   ( ! i n s t . i n l i n e )   { 
 	 	 	 v a r   s h o w A n i m   =   $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s h o w A n i m ' )   | |   ' s h o w ' ; 
 	 	 	 v a r   d u r a t i o n   =   $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' d u r a t i o n ' ) ; 
 	 	 	 v a r   p o s t P r o c e s s   =   f u n c t i o n ( )   { 
 	 	 	 	 $ . d a t e p i c k e r . _ d a t e p i c k e r S h o w i n g   =   t r u e ; 
 	 	 	 	 i f   ( $ . b r o w s e r . m s i e   & &   p a r s e I n t ( $ . b r o w s e r . v e r s i o n , 1 0 )   <   7 )   / /   f i x   I E   <   7   s e l e c t   p r o b l e m s 
 	 	 	 	 	 $ ( ' i f r a m e . u i - d a t e p i c k e r - c o v e r ' ) . c s s ( { w i d t h :   i n s t . d p D i v . w i d t h ( )   +   4 , 
 	 	 	 	 	 	 h e i g h t :   i n s t . d p D i v . h e i g h t ( )   +   4 } ) ; 
 	 	 	 } ; 
 	 	 	 i f   ( $ . e f f e c t s   & &   $ . e f f e c t s [ s h o w A n i m ] ) 
 	 	 	 	 i n s t . d p D i v . s h o w ( s h o w A n i m ,   $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s h o w O p t i o n s ' ) ,   d u r a t i o n ,   p o s t P r o c e s s ) ; 
 	 	 	 e l s e 
 	 	 	 	 i n s t . d p D i v [ s h o w A n i m ] ( d u r a t i o n ,   p o s t P r o c e s s ) ; 
 	 	 	 i f   ( d u r a t i o n   = =   ' ' ) 
 	 	 	 	 p o s t P r o c e s s ( ) ; 
 	 	 	 i f   ( i n s t . i n p u t [ 0 ] . t y p e   ! =   ' h i d d e n ' ) 
 	 	 	 	 i n s t . i n p u t [ 0 ] . f o c u s ( ) ; 
 	 	 	 $ . d a t e p i c k e r . _ c u r I n s t   =   i n s t ; 
 	 	 } 
 	 } , 
 
 	 / *   G e n e r a t e   t h e   d a t e   p i c k e r   c o n t e n t .   * / 
 	 _ u p d a t e D a t e p i c k e r :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   d i m s   =   { w i d t h :   i n s t . d p D i v . w i d t h ( )   +   4 , 
 	 	 	 h e i g h t :   i n s t . d p D i v . h e i g h t ( )   +   4 } ; 
 	 	 v a r   s e l f   =   t h i s ; 
 	 	 i n s t . d p D i v . e m p t y ( ) . a p p e n d ( t h i s . _ g e n e r a t e H T M L ( i n s t ) ) 
 	 	 	 . f i n d ( ' i f r a m e . u i - d a t e p i c k e r - c o v e r ' ) . 
 	 	 	 	 c s s ( { w i d t h :   d i m s . w i d t h ,   h e i g h t :   d i m s . h e i g h t } ) 
 	 	 	 . e n d ( ) 
 	 	 	 . f i n d ( ' b u t t o n ,   . u i - d a t e p i c k e r - p r e v ,   . u i - d a t e p i c k e r - n e x t ,   . u i - d a t e p i c k e r - c a l e n d a r   t d   a ' ) 
 	 	 	 	 . b i n d ( ' m o u s e o u t ' ,   f u n c t i o n ( ) { 
 	 	 	 	 	 $ ( t h i s ) . r e m o v e C l a s s ( ' u i - s t a t e - h o v e r ' ) ; 
 	 	 	 	 	 i f ( t h i s . c l a s s N a m e . i n d e x O f ( ' u i - d a t e p i c k e r - p r e v ' )   ! =   - 1 )   $ ( t h i s ) . r e m o v e C l a s s ( ' u i - d a t e p i c k e r - p r e v - h o v e r ' ) ; 
 	 	 	 	 	 i f ( t h i s . c l a s s N a m e . i n d e x O f ( ' u i - d a t e p i c k e r - n e x t ' )   ! =   - 1 )   $ ( t h i s ) . r e m o v e C l a s s ( ' u i - d a t e p i c k e r - n e x t - h o v e r ' ) ; 
 	 	 	 	 } ) 
 	 	 	 	 . b i n d ( ' m o u s e o v e r ' ,   f u n c t i o n ( ) { 
 	 	 	 	 	 i f   ( ! s e l f . _ i s D i s a b l e d D a t e p i c k e r (   i n s t . i n l i n e   ?   i n s t . d p D i v . p a r e n t ( ) [ 0 ]   :   i n s t . i n p u t [ 0 ] ) )   { 
 	 	 	 	 	 	 $ ( t h i s ) . p a r e n t s ( ' . u i - d a t e p i c k e r - c a l e n d a r ' ) . f i n d ( ' a ' ) . r e m o v e C l a s s ( ' u i - s t a t e - h o v e r ' ) ; 
 	 	 	 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' u i - s t a t e - h o v e r ' ) ; 
 	 	 	 	 	 	 i f ( t h i s . c l a s s N a m e . i n d e x O f ( ' u i - d a t e p i c k e r - p r e v ' )   ! =   - 1 )   $ ( t h i s ) . a d d C l a s s ( ' u i - d a t e p i c k e r - p r e v - h o v e r ' ) ; 
 	 	 	 	 	 	 i f ( t h i s . c l a s s N a m e . i n d e x O f ( ' u i - d a t e p i c k e r - n e x t ' )   ! =   - 1 )   $ ( t h i s ) . a d d C l a s s ( ' u i - d a t e p i c k e r - n e x t - h o v e r ' ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } ) 
 	 	 	 . e n d ( ) 
 	 	 	 . f i n d ( ' . '   +   t h i s . _ d a y O v e r C l a s s   +   '   a ' ) 
 	 	 	 	 . t r i g g e r ( ' m o u s e o v e r ' ) 
 	 	 	 . e n d ( ) ; 
 	 	 v a r   n u m M o n t h s   =   t h i s . _ g e t N u m b e r O f M o n t h s ( i n s t ) ; 
 	 	 v a r   c o l s   =   n u m M o n t h s [ 1 ] ; 
 	 	 v a r   w i d t h   =   1 7 ; 
 	 	 i f   ( c o l s   >   1 )   { 
 	 	 	 i n s t . d p D i v . a d d C l a s s ( ' u i - d a t e p i c k e r - m u l t i - '   +   c o l s ) . c s s ( ' w i d t h ' ,   ( w i d t h   *   c o l s )   +   ' e m ' ) ; 
 	 	 }   e l s e   { 
 	 	 	 i n s t . d p D i v . r e m o v e C l a s s ( ' u i - d a t e p i c k e r - m u l t i - 2   u i - d a t e p i c k e r - m u l t i - 3   u i - d a t e p i c k e r - m u l t i - 4 ' ) . w i d t h ( ' ' ) ; 
 	 	 } 
 	 	 i n s t . d p D i v [ ( n u m M o n t h s [ 0 ]   ! =   1   | |   n u m M o n t h s [ 1 ]   ! =   1   ?   ' a d d '   :   ' r e m o v e ' )   + 
 	 	 	 ' C l a s s ' ] ( ' u i - d a t e p i c k e r - m u l t i ' ) ; 
 	 	 i n s t . d p D i v [ ( 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 ' ] ( ' u i - d a t e p i c k e r - r t l ' ) ; 
 	 	 i f   ( i n s t . i n p u t   & &   i n s t . i n p u t [ 0 ] . t y p e   ! =   ' h i d d e n '   & &   i n s t   = =   $ . d a t e p i c k e r . _ c u r I n s t ) 
 	 	 	 $ ( i n s t . i n p u t [ 0 ] ) . f o c u s ( ) ; 
 	 } , 
 
 	 / *   C h e c k   p o s i t i o n i n g   t o   r e m a i n   o n   s c r e e n .   * / 
 	 _ c h e c k O f f s e t :   f u n c t i o n ( i n s t ,   o f f s e t ,   i s F i x e d )   { 
 	 	 v a r   d p W i d t h   =   i n s t . d p D i v . o u t e r W i d t h ( ) ; 
 	 	 v a r   d p H e i g h t   =   i n s t . d p D i v . o u t e r H e i g h t ( ) ; 
 	 	 v a r   i n p u t W i d t h   =   i n s t . i n p u t   ?   i n s t . i n p u t . o u t e r W i d t h ( )   :   0 ; 
 	 	 v a r   i n p u t H e i g h t   =   i n s t . i n p u t   ?   i n s t . i n p u t . o u t e r H e i g h t ( )   :   0 ; 
 	 	 v a r   v i e w W i d t h   =   ( w i n d o w . i n n e r W i d t h   | |   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t W i d t h   | |   d o c u m e n t . b o d y . c l i e n t W i d t h )   +   $ ( d o c u m e n t ) . s c r o l l L e f t ( ) ; 
 	 	 v a r   v i e w H e i g h t   =   ( w i n d o w . i n n e r H e i g h t   | |   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t H e i g h t   | |   d o c u m e n t . b o d y . c l i e n t H e i g h t )   +   $ ( d o c u m e n t ) . s c r o l l T o p ( ) ; 
 
 	 	 o f f s e t . l e f t   - =   ( t h i s . _ g e t ( i n s t ,   ' i s R T L ' )   ?   ( d p W i d t h   -   i n p u t W i d t h )   :   0 ) ; 
 	 	 o f f s e t . l e f t   - =   ( i s F i x e d   & &   o f f s e t . l e f t   = =   i n s t . i n p u t . o f f s e t ( ) . l e f t )   ?   $ ( d o c u m e n t ) . s c r o l l L e f t ( )   :   0 ; 
 	 	 o f f s e t . t o p   - =   ( i s F i x e d   & &   o f f s e t . t o p   = =   ( i n s t . i n p u t . o f f s e t ( ) . t o p   +   i n p u t H e i g h t ) )   ?   $ ( d o c u m e n t ) . s c r o l l T o p ( )   :   0 ; 
 
 	 	 / /   n o w   c h e c k   i f   d a t e p i c k e r   i s   s h o w i n g   o u t s i d e   w i n d o w   v i e w p o r t   -   m o v e   t o   a   b e t t e r   p l a c e   i f   s o . 
 	 	 o f f s e t . l e f t   - =   ( o f f s e t . l e f t   +   d p W i d t h   >   v i e w W i d t h   & &   v i e w W i d t h   >   d p W i d t h )   ?   M a t h . a b s ( o f f s e t . l e f t   +   d p W i d t h   -   v i e w W i d t h )   :   0 ; 
 	 	 o f f s e t . t o p   - =   ( o f f s e t . t o p   +   d p H e i g h t   >   v i e w H e i g h t   & &   v i e w H e i g h t   >   d p H e i g h t )   ?   M a t h . a b s ( o f f s e t . t o p   +   d p H e i g h t   +   i n p u t H e i g h t * 2   -   v i e w H e i g h t )   :   0 ; 
 
 	 	 r e t u r n   o f f s e t ; 
 	 } , 
 
 	 / *   F i n d   a n   o b j e c t ' s   p o s i t i o n   o n   t h e   s c r e e n .   * / 
 	 _ f i n d P o s :   f u n c t i o n ( o b j )   { 
                 w h i l e   ( o b j   & &   ( o b j . t y p e   = =   ' h i d d e n '   | |   o b j . n o d e T y p e   ! =   1 ) )   { 
                         o b j   =   o b j . n e x t S i b l i n g ; 
                 } 
                 v a r   p o s i t i o n   =   $ ( o b j ) . o f f s e t ( ) ; 
 	         r e t u r n   [ p o s i t i o n . l e f t ,   p o s i t i o n . t o p ] ; 
 	 } , 
 
 	 / *   H i d e   t h e   d a t e   p i c k e r   f r o m   v i e w . 
 	       @ p a r a m     i n p u t     e l e m e n t   -   t h e   i n p u t   f i e l d   a t t a c h e d   t o   t h e   d a t e   p i c k e r 
 	       @ p a r a m     d u r a t i o n     s t r i n g   -   t h e   d u r a t i o n   o v e r   w h i c h   t o   c l o s e   t h e   d a t e   p i c k e r   * / 
 	 _ h i d e D a t e p i c k e r :   f u n c t i o n ( i n p u t ,   d u r a t i o n )   { 
 	 	 v a r   i n s t   =   t h i s . _ c u r I n s t ; 
 	 	 i f   ( ! i n s t   | |   ( i n p u t   & &   i n s t   ! =   $ . d a t a ( i n p u t ,   P R O P _ N A M E ) ) ) 
 	 	 	 r e t u r n ; 
 	 	 i f   ( i n s t . s t a y O p e n ) 
 	 	 	 t h i s . _ s e l e c t D a t e ( ' # '   +   i n s t . i d ,   t h i s . _ f o r m a t D a t e ( i n s t , 
 	 	 	 	 i n s t . c u r r e n t D a y ,   i n s t . c u r r e n t M o n t h ,   i n s t . c u r r e n t Y e a r ) ) ; 
 	 	 i n s t . s t a y O p e n   =   f a l s e ; 
 	 	 i f   ( t h i s . _ d a t e p i c k e r S h o w i n g )   { 
 	 	 	 d u r a t i o n   =   ( d u r a t i o n   ! =   n u l l   ?   d u r a t i o n   :   t h i s . _ g e t ( i n s t ,   ' d u r a t i o n ' ) ) ; 
 	 	 	 v a r   s h o w A n i m   =   t h i s . _ g e t ( i n s t ,   ' s h o w A n i m ' ) ; 
 	 	 	 v a r   p o s t P r o c e s s   =   f u n c t i o n ( )   { 
 	 	 	 	 $ . d a t e p i c k e r . _ t i d y D i a l o g ( i n s t ) ; 
 	 	 	 } ; 
 	 	 	 i f   ( d u r a t i o n   ! =   ' '   & &   $ . e f f e c t s   & &   $ . e f f e c t s [ s h o w A n i m ] ) 
 	 	 	 	 i n s t . d p D i v . h i d e ( s h o w A n i m ,   $ . d a t e p i c k e r . _ g e t ( i n s t ,   ' s h o w O p t i o n s ' ) , 
 	 	 	 	 	 d u r a t i o n ,   p o s t P r o c e s s ) ; 
 	 	 	 e l s e 
 	 	 	 	 i n s t . d p D i v [ ( d u r a t i o n   = =   ' '   ?   ' h i d e '   :   ( s h o w A n i m   = =   ' s l i d e D o w n '   ?   ' s l i d e U p '   : 
 	 	 	 	 	 ( s h o w A n i m   = =   ' f a d e I n '   ?   ' f a d e O u t '   :   ' h i d e ' ) ) ) ] ( d u r a t i o n ,   p o s t P r o c e s s ) ; 
 	 	 	 i f   ( d u r a t i o n   = =   ' ' ) 
 	 	 	 	 t h i s . _ t i d y D i a l o g ( i n s t ) ; 
 	 	 	 v a r   o n C l o s e   =   t h i s . _ g e t ( i n s t ,   ' o n C l o s e ' ) ; 
 	 	 	 i f   ( o n C l o s e ) 
 	 	 	 	 o n C l o s e . a p p l y ( ( i n s t . i n p u t   ?   i n s t . i n p u t [ 0 ]   :   n u l l ) , 
 	 	 	 	 	 [ ( i n s t . i n p u t   ?   i n s t . i n p u t . v a l ( )   :   ' ' ) ,   i n s t ] ) ;     / /   t r i g g e r   c u s t o m   c a l l b a c k 
 	 	 	 t h i s . _ d a t e p i c k e r S h o w i n g   =   f a l s e ; 
 	 	 	 t h i s . _ l a s t I n p u t   =   n u l l ; 
 	 	 	 i f   ( t h i s . _ i n D i a l o g )   { 
 	 	 	 	 t h i s . _ d i a l o g I n p u t . c s s ( {   p o s i t i o n :   ' a b s o l u t e ' ,   l e f t :   ' 0 ' ,   t o p :   ' - 1 0 0 p x '   } ) ; 
 	 	 	 	 i f   ( $ . b l o c k U I )   { 
 	 	 	 	 	 $ . u n b l o c k U I ( ) ; 
 	 	 	 	 	 $ ( ' b o d y ' ) . a p p e n d ( t h i s . d p D i v ) ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 t h i s . _ i n D i a l o g   =   f a l s e ; 
 	 	 } 
 	 	 t h i s . _ c u r I n s t   =   n u l l ; 
 	 } , 
 
 	 / *   T i d y   u p   a f t e r   a   d i a l o g   d i s p l a y .   * / 
 	 _ t i d y D i a l o g :   f u n c t i o n ( i n s t )   { 
 	 	 i n s t . d p D i v . r e m o v e C l a s s ( t h i s . _ d i a l o g C l a s s ) . u n b i n d ( ' . u i - d a t e p i c k e r - c a l e n d a r ' ) ; 
 	 } , 
 
 	 / *   C l o s e   d a t e   p i c k e r   i f   c l i c k e d   e l s e w h e r e .   * / 
 	 _ c h e c k E x t e r n a l C l i c k :   f u n c t i o n ( e v e n t )   { 
 	 	 i f   ( ! $ . d a t e p i c k e r . _ c u r I n s t ) 
 	 	 	 r e t u r n ; 
 	 	 v a r   $ t a r g e t   =   $ ( e v e n t . t a r g e t ) ; 
 	 	 i f   ( ( $ t a r g e t . p a r e n t s ( ' # '   +   $ . d a t e p i c k e r . _ m a i n D i v I d ) . l e n g t h   = =   0 )   & & 
 	 	 	 	 ! $ t a r g e t . h a s C l a s s ( $ . d a t e p i c k e r . m a r k e r C l a s s N a m e )   & & 
 	 	 	 	 ! $ t a r g e t . h a s C l a s s ( $ . d a t e p i c k e r . _ t r i g g e r C l a s s )   & & 
 	 	 	 	 $ . d a t e p i c k e r . _ d a t e p i c k e r S h o w i n g   & &   ! ( $ . d a t e p i c k e r . _ i n D i a l o g   & &   $ . b l o c k U I ) ) 
 	 	 	 $ . d a t e p i c k e r . _ h i d e D a t e p i c k e r ( n u l l ,   ' ' ) ; 
 	 } , 
 
 	 / *   A d j u s t   o n e   o f   t h e   d a t e   s u b - f i e l d s .   * / 
 	 _ a d j u s t D a t e :   f u n c t i o n ( i d ,   o f f s e t ,   p e r i o d )   { 
 	 	 v a r   t a r g e t   =   $ ( i d ) ; 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t [ 0 ] ) ; 
 	 	 i f   ( t h i s . _ i s D i s a b l e d D a t e p i c k e r ( t a r g e t [ 0 ] ) )   { 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 t h i s . _ a d j u s t I n s t D a t e ( i n s t ,   o f f s e t   + 
 	 	 	 ( p e r i o d   = =   ' M '   ?   t h i s . _ g e t ( i n s t ,   ' s h o w C u r r e n t A t P o s ' )   :   0 ) ,   / /   u n d o   p o s i t i o n i n g 
 	 	 	 p e r i o d ) ; 
 	 	 t h i s . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 } , 
 
 	 / *   A c t i o n   f o r   c u r r e n t   l i n k .   * / 
 	 _ g o t o T o d a y :   f u n c t i o n ( i d )   { 
 	 	 v a r   t a r g e t   =   $ ( i d ) ; 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t [ 0 ] ) ; 
 	 	 i f   ( t h i s . _ g e t ( i n s t ,   ' g o t o C u r r e n t ' )   & &   i n s t . c u r r e n t D a y )   { 
 	 	 	 i n s t . s e l e c t e d D a y   =   i n s t . c u r r e n t D a y ; 
 	 	 	 i n s t . d r a w M o n t h   =   i n s t . s e l e c t e d M o n t h   =   i n s t . c u r r e n t M o n t h ; 
 	 	 	 i n s t . d r a w Y e a r   =   i n s t . s e l e c t e d Y e a r   =   i n s t . c u r r e n t Y e a r ; 
 	 	 } 
 	 	 e l s e   { 
 	 	 v a r   d a t e   =   n e w   D a t e ( ) ; 
 	 	 i n s t . s e l e c t e d D a y   =   d a t e . g e t D a t e ( ) ; 
 	 	 i n s t . d r a w M o n t h   =   i n s t . s e l e c t e d M o n t h   =   d a t e . g e t M o n t h ( ) ; 
 	 	 i n s t . d r a w Y e a r   =   i n s t . s e l e c t e d Y e a r   =   d a t e . g e t F u l l Y e a r ( ) ; 
 	 	 } 
 	 	 t h i s . _ n o t i f y C h a n g e ( i n s t ) ; 
 	 	 t h i s . _ a d j u s t D a t e ( t a r g e t ) ; 
 	 } , 
 
 	 / *   A c t i o n   f o r   s e l e c t i n g   a   n e w   m o n t h / y e a r .   * / 
 	 _ s e l e c t M o n t h Y e a r :   f u n c t i o n ( i d ,   s e l e c t ,   p e r i o d )   { 
 	 	 v a r   t a r g e t   =   $ ( i d ) ; 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t [ 0 ] ) ; 
 	 	 i n s t . _ s e l e c t i n g M o n t h Y e a r   =   f a l s e ; 
 	 	 i n s t [ ' s e l e c t e d '   +   ( p e r i o d   = =   ' M '   ?   ' M o n t h '   :   ' Y e a r ' ) ]   = 
 	 	 i n s t [ ' d r a w '   +   ( p e r i o d   = =   ' M '   ?   ' M o n t h '   :   ' Y e a r ' ) ]   = 
 	 	 	 p a r s e I n t ( s e l e c t . o p t i o n s [ s e l e c t . s e l e c t e d I n d e x ] . v a l u e , 1 0 ) ; 
 	 	 t h i s . _ n o t i f y C h a n g e ( i n s t ) ; 
 	 	 t h i s . _ a d j u s t D a t e ( t a r g e t ) ; 
 	 } , 
 
 	 / *   R e s t o r e   i n p u t   f o c u s   a f t e r   n o t   c h a n g i n g   m o n t h / y e a r .   * / 
 	 _ c l i c k M o n t h Y e a r :   f u n c t i o n ( i d )   { 
 	 	 v a r   t a r g e t   =   $ ( i d ) ; 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t [ 0 ] ) ; 
 	 	 i f   ( i n s t . i n p u t   & &   i n s t . _ s e l e c t i n g M o n t h Y e a r   & &   ! $ . b r o w s e r . m s i e ) 
 	 	 	 i n s t . i n p u t [ 0 ] . f o c u s ( ) ; 
 	 	 i n s t . _ s e l e c t i n g M o n t h Y e a r   =   ! i n s t . _ s e l e c t i n g M o n t h Y e a r ; 
 	 } , 
 
 	 / *   A c t i o n   f o r   s e l e c t i n g   a   d a y .   * / 
 	 _ s e l e c t D a y :   f u n c t i o n ( i d ,   m o n t h ,   y e a r ,   t d )   { 
 	 	 v a r   t a r g e t   =   $ ( i d ) ; 
 	 	 i f   ( $ ( t d ) . h a s C l a s s ( t h i s . _ u n s e l e c t a b l e C l a s s )   | |   t h i s . _ i s D i s a b l e d D a t e p i c k e r ( t a r g e t [ 0 ] ) )   { 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t [ 0 ] ) ; 
 	 	 i n s t . s e l e c t e d D a y   =   i n s t . c u r r e n t D a y   =   $ ( ' a ' ,   t d ) . h t m l ( ) ; 
 	 	 i n s t . s e l e c t e d M o n t h   =   i n s t . c u r r e n t M o n t h   =   m o n t h ; 
 	 	 i n s t . s e l e c t e d Y e a r   =   i n s t . c u r r e n t Y e a r   =   y e a r ; 
 	 	 i f   ( i n s t . s t a y O p e n )   { 
 	 	 	 i n s t . e n d D a y   =   i n s t . e n d M o n t h   =   i n s t . e n d Y e a r   =   n u l l ; 
 	 	 } 
 	 	 t h i s . _ s e l e c t D a t e ( i d ,   t h i s . _ f o r m a t D a t e ( i n s t , 
 	 	 	 i n s t . c u r r e n t D a y ,   i n s t . c u r r e n t M o n t h ,   i n s t . c u r r e n t Y e a r ) ) ; 
 	 	 i f   ( i n s t . s t a y O p e n )   { 
 	 	 	 i n s t . r a n g e S t a r t   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( 
 	 	 	 	 n e w   D a t e ( i n s t . c u r r e n t Y e a r ,   i n s t . c u r r e n t M o n t h ,   i n s t . c u r r e n t D a y ) ) ; 
 	 	 	 t h i s . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 	 } 
 	 } , 
 
 	 / *   E r a s e   t h e   i n p u t   f i e l d   a n d   h i d e   t h e   d a t e   p i c k e r .   * / 
 	 _ c l e a r D a t e :   f u n c t i o n ( i d )   { 
 	 	 v a r   t a r g e t   =   $ ( i d ) ; 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t [ 0 ] ) ; 
 	 	 i n s t . s t a y O p e n   =   f a l s e ; 
 	 	 i n s t . e n d D a y   =   i n s t . e n d M o n t h   =   i n s t . e n d Y e a r   =   i n s t . r a n g e S t a r t   =   n u l l ; 
 	 	 t h i s . _ s e l e c t D a t e ( t a r g e t ,   ' ' ) ; 
 	 } , 
 
 	 / *   U p d a t e   t h e   i n p u t   f i e l d   w i t h   t h e   s e l e c t e d   d a t e .   * / 
 	 _ s e l e c t D a t e :   f u n c t i o n ( i d ,   d a t e S t r )   { 
 	 	 v a r   t a r g e t   =   $ ( i d ) ; 
 	 	 v a r   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t [ 0 ] ) ; 
 	 	 d a t e S t r   =   ( d a t e S t r   ! =   n u l l   ?   d a t e S t r   :   t h i s . _ f o r m a t D a t e ( i n s t ) ) ; 
 	 	 i f   ( i n s t . i n p u t ) 
 	 	 	 i n s t . i n p u t . v a l ( d a t e S t r ) ; 
 	 	 t h i s . _ u p d a t e A l t e r n a t e ( i n s t ) ; 
 	 	 v a r   o n S e l e c t   =   t h i s . _ g e t ( i n s t ,   ' o n S e l e c t ' ) ; 
 	 	 i f   ( o n S e l e c t ) 
 	 	 	 o n S e l e c t . a p p l y ( ( i n s t . i n p u t   ?   i n s t . i n p u t [ 0 ]   :   n u l l ) ,   [ d a t e S t r ,   i n s t ] ) ;     / /   t r i g g e r   c u s t o m   c a l l b a c k 
 	 	 e l s e   i f   ( i n s t . i n p u t ) 
 	 	 	 i n s t . i n p u t . t r i g g e r ( ' c h a n g e ' ) ;   / /   f i r e   t h e   c h a n g e   e v e n t 
 	 	 i f   ( i n s t . i n l i n e ) 
 	 	 	 t h i s . _ u p d a t e D a t e p i c k e r ( i n s t ) ; 
 	 	 e l s e   i f   ( ! i n s t . s t a y O p e n )   { 
 	 	 	 t h i s . _ h i d e D a t e p i c k e r ( n u l l ,   t h i s . _ g e t ( i n s t ,   ' d u r a t i o n ' ) ) ; 
 	 	 	 t h i s . _ l a s t I n p u t   =   i n s t . i n p u t [ 0 ] ; 
 	 	 	 i f   ( t y p e o f ( i n s t . i n p u t [ 0 ] )   ! =   ' o b j e c t ' ) 
 	 	 	 	 i n s t . i n p u t [ 0 ] . f o c u s ( ) ;   / /   r e s t o r e   f o c u s 
 	 	 	 t h i s . _ l a s t I n p u t   =   n u l l ; 
 	 	 } 
 	 } , 
 
 	 / *   U p d a t e   a n y   a l t e r n a t e   f i e l d   t o   s y n c h r o n i s e   w i t h   t h e   m a i n   f i e l d .   * / 
 	 _ u p d a t e A l t e r n a t e :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   a l t F i e l d   =   t h i s . _ g e t ( i n s t ,   ' a l t F i e l d ' ) ; 
 	 	 i f   ( a l t F i e l d )   {   / /   u p d a t e   a l t e r n a t e   f i e l d   t o o 
 	 	 	 v a r   a l t F o r m a t   =   t h i s . _ g e t ( i n s t ,   ' a l t F o r m a t ' )   | |   t h i s . _ g e t ( i n s t ,   ' d a t e F o r m a t ' ) ; 
 	 	 	 v a r   d a t e   =   t h i s . _ g e t D a t e ( i n s t ) ; 
 	 	 	 d a t e S t r   =   t h i s . f o r m a t D a t e ( a l t F o r m a t ,   d a t e ,   t h i s . _ g e t F o r m a t C o n f i g ( i n s t ) ) ; 
 	 	 	 $ ( a l t F i e l d ) . e a c h ( f u n c t i o n ( )   {   $ ( t h i s ) . v a l ( d a t e S t r ) ;   } ) ; 
 	 	 } 
 	 } , 
 
 	 / *   S e t   a s   b e f o r e S h o w D a y   f u n c t i o n   t o   p r e v e n t   s e l e c t i o n   o f   w e e k e n d s . 
 	       @ p a r a m     d a t e     D a t e   -   t h e   d a t e   t o   c u s t o m i s e 
 	       @ r e t u r n   [ b o o l e a n ,   s t r i n g ]   -   i s   t h i s   d a t e   s e l e c t a b l e ? ,   w h a t   i s   i t s   C S S   c l a s s ?   * / 
 	 n o W e e k e n d s :   f u n c t i o n ( d a t e )   { 
 	 	 v a r   d a y   =   d a t e . g e t D a y ( ) ; 
 	 	 r e t u r n   [ ( d a y   >   0   & &   d a y   <   6 ) ,   ' ' ] ; 
 	 } , 
 
 	 / *   S e t   a s   c a l c u l a t e W e e k   t o   d e t e r m i n e   t h e   w e e k   o f   t h e   y e a r   b a s e d   o n   t h e   I S O   8 6 0 1   d e f i n i t i o n . 
 	       @ p a r a m     d a t e     D a t e   -   t h e   d a t e   t o   g e t   t h e   w e e k   f o r 
 	       @ r e t u r n     n u m b e r   -   t h e   n u m b e r   o f   t h e   w e e k   w i t h i n   t h e   y e a r   t h a t   c o n t a i n s   t h i s   d a t e   * / 
 	 i s o 8 6 0 1 W e e k :   f u n c t i o n ( d a t e )   { 
 	 	 v a r   c h e c k D a t e   =   n e w   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 ( ) ,   d a t e . g e t D a t e ( ) ) ; 
 	 	 v a r   f i r s t M o n   =   n e w   D a t e ( c h e c k D a t e . g e t F u l l Y e a r ( ) ,   1   -   1 ,   4 ) ;   / /   F i r s t   w e e k   a l w a y s   c o n t a i n s   4   J a n 
 	 	 v a r   f i r s t D a y   =   f i r s t M o n . g e t D a y ( )   | |   7 ;   / /   D a y   o f   w e e k :   M o n   =   1 ,   . . . ,   S u n   =   7 
 	 	 f i r s t M o n . s e t D a t e ( f i r s t M o n . g e t D a t e ( )   +   1   -   f i r s t D a y ) ;   / /   P r e c e d i n g   M o n d a y 
 	 	 i f   ( f i r s t D a y   <   4   & &   c h e c k D a t e   <   f i r s t M o n )   {   / /   A d j u s t   f i r s t   t h r e e   d a y s   i n   y e a r   i f   n e c e s s a r y 
 	 	 	 c h e c k D a t e . s e t D a t e ( c h e c k D a t e . g e t D a t e ( )   -   3 ) ;   / /   G e n e r a t e   f o r   p r e v i o u s   y e a r 
 	 	 	 r e t u r n   $ . d a t e p i c k e r . i s o 8 6 0 1 W e e k ( c h e c k D a t e ) ; 
 	 	 }   e l s e   i f   ( c h e c k D a t e   >   n e w   D a t e ( c h e c k D a t e . g e t F u l l Y e a r ( ) ,   1 2   -   1 ,   2 8 ) )   {   / /   C h e c k   l a s t   t h r e e   d a y s   i n   y e a r 
 	 	 	 f i r s t D a y   =   n e w   D a t e ( c h e c k D a t e . g e t F u l l Y e a r ( )   +   1 ,   1   -   1 ,   4 ) . g e t D a y ( )   | |   7 ; 
 	 	 	 i f   ( f i r s t D a y   >   4   & &   ( c h e c k D a t e . g e t D a y ( )   | |   7 )   <   f i r s t D a y   -   3 )   {   / /   A d j u s t   i f   n e c e s s a r y 
 	 	 	 	 r e t u r n   1 ; 
 	 	 	 } 
 	 	 } 
 	 	 r e t u r n   M a t h . f l o o r ( ( ( c h e c k D a t e   -   f i r s t M o n )   /   8 6 4 0 0 0 0 0 )   /   7 )   +   1 ;   / /   W e e k s   t o   g i v e n   d a t e 
 	 } , 
 
 	 / *   P a r s e   a   s t r i n g   v a l u e   i n t o   a   d a t e   o b j e c t . 
 	       S e e   f o r m a t D a t e   b e l o w   f o r   t h e   p o s s i b l e   f o r m a t s . 
 
 	       @ p a r a m     f o r m a t         s t r i n g   -   t h e   e x p e c t e d   f o r m a t   o f   t h e   d a t e 
 	       @ p a r a m     v a l u e           s t r i n g   -   t h e   d a t e   i n   t h e   a b o v e   f o r m a t 
 	       @ p a r a m     s e t t i n g s     O b j e c t   -   a t t r i b u t e s   i n c l u d e : 
 	                                           s h o r t Y e a r C u t o f f     n u m b e r   -   t h e   c u t o f f   y e a r   f o r   d e t e r m i n i n g   t h e   c e n t u r y   ( o p t i o n a l ) 
 	                                           d a y N a m e s S h o r t         s t r i n g [ 7 ]   -   a b b r e v i a t e d   n a m e s   o f   t h e   d a y s   f r o m   S u n d a y   ( o p t i o n a l ) 
 	                                           d a y N a m e s                   s t r i n g [ 7 ]   -   n a m e s   o f   t h e   d a y s   f r o m   S u n d a y   ( o p t i o n a l ) 
 	                                           m o n t h N a m e s S h o r t     s t r i n g [ 1 2 ]   -   a b b r e v i a t e d   n a m e s   o f   t h e   m o n t h s   ( o p t i o n a l ) 
 	                                           m o n t h N a m e s               s t r i n g [ 1 2 ]   -   n a m e s   o f   t h e   m o n t h s   ( o p t i o n a l ) 
 	       @ r e t u r n     D a t e   -   t h e   e x t r a c t e d   d a t e   v a l u e   o r   n u l l   i f   v a l u e   i s   b l a n k   * / 
 	 p a r s e D a t e :   f u n c t i o n   ( f o r m a t ,   v a l u e ,   s e t t i n g s )   { 
 	 	 i f   ( f o r m a t   = =   n u l l   | |   v a l u e   = =   n u l l ) 
 	 	 	 t h r o w   ' I n v a l i d   a r g u m e n t s ' ; 
 	 	 v a l u e   =   ( t y p e o f   v a l u e   = =   ' o b j e c t '   ?   v a l u e . t o S t r i n g ( )   :   v a l u e   +   ' ' ) ; 
 	 	 i f   ( v a l u e   = =   ' ' ) 
 	 	 	 r e t u r n   n u l l ; 
 	 	 v a r   s h o r t Y e a r C u t o f f   =   ( s e t t i n g s   ?   s e t t i n g s . s h o r t Y e a r C u t o f f   :   n u l l )   | |   t h i s . _ d e f a u l t s . s h o r t Y e a r C u t o f f ; 
 	 	 v a r   d a y N a m e s S h o r t   =   ( s e t t i n g s   ?   s e t t i n g s . d a y N a m e s S h o r t   :   n u l l )   | |   t h i s . _ d e f a u l t s . d a y N a m e s S h o r t ; 
 	 	 v a r   d a y N a m e s   =   ( s e t t i n g s   ?   s e t t i n g s . d a y N a m e s   :   n u l l )   | |   t h i s . _ d e f a u l t s . d a y N a m e s ; 
 	 	 v a r   m o n t h N a m e s S h o r t   =   ( s e t t i n g s   ?   s e t t i n g s . m o n t h N a m e s S h o r t   :   n u l l )   | |   t h i s . _ d e f a u l t s . m o n t h N a m e s S h o r t ; 
 	 	 v a r   m o n t h N a m e s   =   ( s e t t i n g s   ?   s e t t i n g s . m o n t h N a m e s   :   n u l l )   | |   t h i s . _ d e f a u l t s . m o n t h N a m e s ; 
 	 	 v a r   y e a r   =   - 1 ; 
 	 	 v a r   m o n t h   =   - 1 ; 
 	 	 v a r   d a y   =   - 1 ; 
 	 	 v a r   d o y   =   - 1 ; 
 	 	 v a r   l i t e r a l   =   f a l s e ; 
 	 	 / /   C h e c k   w h e t h e r   a   f o r m a t   c h a r a c t e r   i s   d o u b l e d 
 	 	 v a r   l o o k A h e a d   =   f u n c t i o n ( m a t c h )   { 
 	 	 	 v a r   m a t c h e s   =   ( i F o r m a t   +   1   <   f o r m a t . l e n g t h   & &   f o r m a t . c h a r A t ( i F o r m a t   +   1 )   = =   m a t c h ) ; 
 	 	 	 i f   ( m a t c h e s ) 
 	 	 	 	 i F o r m a t + + ; 
 	 	 	 r e t u r n   m a t c h e s ; 
 	 	 } ; 
 	 	 / /   E x t r a c t   a   n u m b e r   f r o m   t h e   s t r i n g   v a l u e 
 	 	 v a r   g e t N u m b e r   =   f u n c t i o n ( m a t c h )   { 
 	 	 	 l o o k A h e a d ( m a t c h ) ; 
 	 	 	 v a r   o r i g S i z e   =   ( m a t c h   = =   ' @ '   ?   1 4   :   ( m a t c h   = =   ' y '   ?   4   :   ( m a t c h   = =   ' o '   ?   3   :   2 ) ) ) ; 
 	 	 	 v a r   s i z e   =   o r i g S i z e ; 
 	 	 	 v a r   n u m   =   0 ; 
 	 	 	 w h i l e   ( s i z e   >   0   & &   i V a l u e   <   v a l u e . l e n g t h   & & 
 	 	 	 	 	 v a l u e . c h a r A t ( i V a l u e )   > =   ' 0 '   & &   v a l u e . c h a r A t ( i V a l u e )   < =   ' 9 ' )   { 
 	 	 	 	 n u m   =   n u m   *   1 0   +   p a r s e I n t ( v a l u e . c h a r A t ( i V a l u e + + ) , 1 0 ) ; 
 	 	 	 	 s i z e - - ; 
 	 	 	 } 
 	 	 	 i f   ( s i z e   = =   o r i g S i z e ) 
 	 	 	 	 t h r o w   ' M i s s i n g   n u m b e r   a t   p o s i t i o n   '   +   i V a l u e ; 
 	 	 	 r e t u r n   n u m ; 
 	 	 } ; 
 	 	 / /   E x t r a c t   a   n a m e   f r o m   t h e   s t r i n g   v a l u e   a n d   c o n v e r t   t o   a n   i n d e x 
 	 	 v a r   g e t N a m e   =   f u n c t i o n ( m a t c h ,   s h o r t N a m e s ,   l o n g N a m e s )   { 
 	 	 	 v a r   n a m e s   =   ( l o o k A h e a d ( m a t c h )   ?   l o n g N a m e s   :   s h o r t N a m e s ) ; 
 	 	 	 v a r   s i z e   =   0 ; 
 	 	 	 f o r   ( v a r   j   =   0 ;   j   <   n a m e s . l e n g t h ;   j + + ) 
 	 	 	 	 s i z e   =   M a t h . m a x ( s i z e ,   n a m e s [ j ] . l e n g t h ) ; 
 	 	 	 v a r   n a m e   =   ' ' ; 
 	 	 	 v a r   i I n i t   =   i V a l u e ; 
 	 	 	 w h i l e   ( s i z e   >   0   & &   i V a l u e   <   v a l u e . l e n g t h )   { 
 	 	 	 	 n a m e   + =   v a l u e . c h a r A t ( i V a l u e + + ) ; 
 	 	 	 	 f o r   ( v a r   i   =   0 ;   i   <   n a m e s . l e n g t h ;   i + + ) 
 	 	 	 	 	 i f   ( n a m e   = =   n a m e s [ i ] ) 
 	 	 	 	 	 	 r e t u r n   i   +   1 ; 
 	 	 	 	 s i z e - - ; 
 	 	 	 } 
 	 	 	 t h r o w   ' U n k n o w n   n a m e   a t   p o s i t i o n   '   +   i I n i t ; 
 	 	 } ; 
 	 	 / /   C o n f i r m   t h a t   a   l i t e r a l   c h a r a c t e r   m a t c h e s   t h e   s t r i n g   v a l u e 
 	 	 v a r   c h e c k L i t e r a l   =   f u n c t i o n ( )   { 
 	 	 	 i f   ( v a l u e . c h a r A t ( i V a l u e )   ! =   f o r m a t . c h a r A t ( i F o r m a t ) ) 
 	 	 	 	 t h r o w   ' U n e x p e c t e d   l i t e r a l   a t   p o s i t i o n   '   +   i V a l u e ; 
 	 	 	 i V a l u e + + ; 
 	 	 } ; 
 	 	 v a r   i V a l u e   =   0 ; 
 	 	 f o r   ( v a r   i F o r m a t   =   0 ;   i F o r m a t   <   f o r m a t . l e n g t h ;   i F o r m a t + + )   { 
 	 	 	 i f   ( l i t e r a l ) 
 	 	 	 	 i f   ( f o r m a t . c h a r A t ( i F o r m a t )   = =   " ' "   & &   ! l o o k A h e a d ( " ' " ) ) 
 	 	 	 	 	 l i t e r a l   =   f a l s e ; 
 	 	 	 	 e l s e 
 	 	 	 	 	 c h e c k L i t e r a l ( ) ; 
 	 	 	 e l s e 
 	 	 	 	 s w i t c h   ( f o r m a t . c h a r A t ( i F o r m a t ) )   { 
 	 	 	 	 	 c a s e   ' d ' : 
 	 	 	 	 	 	 d a y   =   g e t N u m b e r ( ' d ' ) ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   ' D ' : 
 	 	 	 	 	 	 g e t N a m e ( ' D ' ,   d a y N a m e s S h o r t ,   d a y N a m e s ) ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   ' o ' : 
 	 	 	 	 	 	 d o y   =   g e t N u m b e r ( ' o ' ) ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   ' m ' : 
 	 	 	 	 	 	 m o n t h   =   g e t N u m b e r ( ' m ' ) ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   ' M ' : 
 	 	 	 	 	 	 m o n t h   =   g e t N a m e ( ' M ' ,   m o n t h N a m e s S h o r t ,   m o n t h N a m e s ) ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   ' y ' : 
 	 	 	 	 	 	 y e a r   =   g e t N u m b e r ( ' y ' ) ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   ' @ ' : 
 	 	 	 	 	 	 v a r   d a t e   =   n e w   D a t e ( g e t N u m b e r ( ' @ ' ) ) ; 
 	 	 	 	 	 	 y e a r   =   d a t e . g e t F u l l Y e a r ( ) ; 
 	 	 	 	 	 	 m o n t h   =   d a t e . g e t M o n t h ( )   +   1 ; 
 	 	 	 	 	 	 d a y   =   d a t e . g e t D a t e ( ) ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   " ' " : 
 	 	 	 	 	 	 i f   ( l o o k A h e a d ( " ' " ) ) 
 	 	 	 	 	 	 	 c h e c k L i t e r a l ( ) ; 
 	 	 	 	 	 	 e l s e 
 	 	 	 	 	 	 	 l i t e r a l   =   t r u e ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 d e f a u l t : 
 	 	 	 	 	 	 c h e c k L i t e r a l ( ) ; 
 	 	 	 	 } 
 	 	 } 
 	 	 i f   ( y e a r   = =   - 1 ) 
 	 	 	 y e a r   =   n e w   D a t e ( ) . g e t F u l l Y e a r ( ) ; 
 	 	 e l s e   i f   ( y e a r   <   1 0 0 ) 
 	 	 	 y e a r   + =   n e w   D a t e ( ) . g e t F u l l Y e a r ( )   -   n e w   D a t e ( ) . g e t F u l l Y e a r ( )   %   1 0 0   + 
 	 	 	 	 ( y e a r   < =   s h o r t Y e a r C u t o f f   ?   0   :   - 1 0 0 ) ; 
 	 	 i f   ( d o y   >   - 1 )   { 
 	 	 	 m o n t h   =   1 ; 
 	 	 	 d a y   =   d o y ; 
 	 	 	 d o   { 
 	 	 	 	 v a r   d i m   =   t h i s . _ g e t D a y s I n M o n t h ( y e a r ,   m o n t h   -   1 ) ; 
 	 	 	 	 i f   ( d a y   < =   d i m ) 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 m o n t h + + ; 
 	 	 	 	 d a y   - =   d i m ; 
 	 	 	 }   w h i l e   ( t r u e ) ; 
 	 	 } 
 	 	 v a r   d a t e   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( y e a r ,   m o n t h   -   1 ,   d a y ) ) ; 
 	 	 i f   ( d a t e . g e t F u l l Y e a r ( )   ! =   y e a r   | |   d a t e . g e t M o n t h ( )   +   1   ! =   m o n t h   | |   d a t e . g e t D a t e ( )   ! =   d a y ) 
 	 	 	 t h r o w   ' I n v a l i d   d a t e ' ;   / /   E . g .   3 1 / 0 2 / * 
 	 	 r e t u r n   d a t e ; 
 	 } , 
 
 	 / *   S t a n d a r d   d a t e   f o r m a t s .   * / 
 	 A T O M :   ' y y - m m - d d ' ,   / /   R F C   3 3 3 9   ( I S O   8 6 0 1 ) 
 	 C O O K I E :   ' D ,   d d   M   y y ' , 
 	 I S O _ 8 6 0 1 :   ' y y - m m - d d ' , 
 	 R F C _ 8 2 2 :   ' D ,   d   M   y ' , 
 	 R F C _ 8 5 0 :   ' D D ,   d d - M - y ' , 
 	 R F C _ 1 0 3 6 :   ' D ,   d   M   y ' , 
 	 R F C _ 1 1 2 3 :   ' D ,   d   M   y y ' , 
 	 R F C _ 2 8 2 2 :   ' D ,   d   M   y y ' , 
 	 R S S :   ' D ,   d   M   y ' ,   / /   R F C   8 2 2 
 	 T I M E S T A M P :   ' @ ' , 
 	 W 3 C :   ' y y - m m - d d ' ,   / /   I S O   8 6 0 1 
 
 	 / *   F o r m a t   a   d a t e   o b j e c t   i n t o   a   s t r i n g   v a l u e . 
 	       T h e   f o r m a t   c a n   b e   c o m b i n a t i o n s   o f   t h e   f o l l o w i n g : 
 	       d     -   d a y   o f   m o n t h   ( n o   l e a d i n g   z e r o ) 
 	       d d   -   d a y   o f   m o n t h   ( t w o   d i g i t ) 
 	       o     -   d a y   o f   y e a r   ( n o   l e a d i n g   z e r o s ) 
 	       o o   -   d a y   o f   y e a r   ( t h r e e   d i g i t ) 
 	       D     -   d a y   n a m e   s h o r t 
 	       D D   -   d a y   n a m e   l o n g 
 	       m     -   m o n t h   o f   y e a r   ( n o   l e a d i n g   z e r o ) 
 	       m m   -   m o n t h   o f   y e a r   ( t w o   d i g i t ) 
 	       M     -   m o n t h   n a m e   s h o r t 
 	       M M   -   m o n t h   n a m e   l o n g 
 	       y     -   y e a r   ( t w o   d i g i t ) 
 	       y y   -   y e a r   ( f o u r   d i g i t ) 
 	       @   -   U n i x   t i m e s t a m p   ( m s   s i n c e   0 1 / 0 1 / 1 9 7 0 ) 
 	       ' . . . '   -   l i t e r a l   t e x t 
 	       ' '   -   s i n g l e   q u o t e 
 
 	       @ p a r a m     f o r m a t         s t r i n g   -   t h e   d e s i r e d   f o r m a t   o f   t h e   d a t e 
 	       @ p a r a m     d a t e             D a t e   -   t h e   d a t e   v a l u e   t o   f o r m a t 
 	       @ p a r a m     s e t t i n g s     O b j e c t   -   a t t r i b u t e s   i n c l u d e : 
 	                                           d a y N a m e s S h o r t         s t r i n g [ 7 ]   -   a b b r e v i a t e d   n a m e s   o f   t h e   d a y s   f r o m   S u n d a y   ( o p t i o n a l ) 
 	                                           d a y N a m e s                   s t r i n g [ 7 ]   -   n a m e s   o f   t h e   d a y s   f r o m   S u n d a y   ( o p t i o n a l ) 
 	                                           m o n t h N a m e s S h o r t     s t r i n g [ 1 2 ]   -   a b b r e v i a t e d   n a m e s   o f   t h e   m o n t h s   ( o p t i o n a l ) 
 	                                           m o n t h N a m e s               s t r i n g [ 1 2 ]   -   n a m e s   o f   t h e   m o n t h s   ( o p t i o n a l ) 
 	       @ r e t u r n     s t r i n g   -   t h e   d a t e   i n   t h e   a b o v e   f o r m a t   * / 
 	 f o r m a t D a t e :   f u n c t i o n   ( f o r m a t ,   d a t e ,   s e t t i n g s )   { 
 	 	 i f   ( ! d a t e ) 
 	 	 	 r e t u r n   ' ' ; 
 	 	 v a r   d a y N a m e s S h o r t   =   ( s e t t i n g s   ?   s e t t i n g s . d a y N a m e s S h o r t   :   n u l l )   | |   t h i s . _ d e f a u l t s . d a y N a m e s S h o r t ; 
 	 	 v a r   d a y N a m e s   =   ( s e t t i n g s   ?   s e t t i n g s . d a y N a m e s   :   n u l l )   | |   t h i s . _ d e f a u l t s . d a y N a m e s ; 
 	 	 v a r   m o n t h N a m e s S h o r t   =   ( s e t t i n g s   ?   s e t t i n g s . m o n t h N a m e s S h o r t   :   n u l l )   | |   t h i s . _ d e f a u l t s . m o n t h N a m e s S h o r t ; 
 	 	 v a r   m o n t h N a m e s   =   ( s e t t i n g s   ?   s e t t i n g s . m o n t h N a m e s   :   n u l l )   | |   t h i s . _ d e f a u l t s . m o n t h N a m e s ; 
 	 	 / /   C h e c k   w h e t h e r   a   f o r m a t   c h a r a c t e r   i s   d o u b l e d 
 	 	 v a r   l o o k A h e a d   =   f u n c t i o n ( m a t c h )   { 
 	 	 	 v a r   m a t c h e s   =   ( i F o r m a t   +   1   <   f o r m a t . l e n g t h   & &   f o r m a t . c h a r A t ( i F o r m a t   +   1 )   = =   m a t c h ) ; 
 	 	 	 i f   ( m a t c h e s ) 
 	 	 	 	 i F o r m a t + + ; 
 	 	 	 r e t u r n   m a t c h e s ; 
 	 	 } ; 
 	 	 / /   F o r m a t   a   n u m b e r ,   w i t h   l e a d i n g   z e r o   i f   n e c e s s a r y 
 	 	 v a r   f o r m a t N u m b e r   =   f u n c t i o n ( m a t c h ,   v a l u e ,   l e n )   { 
 	 	 	 v a r   n u m   =   ' '   +   v a l u e ; 
 	 	 	 i f   ( l o o k A h e a d ( m a t c h ) ) 
 	 	 	 	 w h i l e   ( n u m . l e n g t h   <   l e n ) 
 	 	 	 	 	 n u m   =   ' 0 '   +   n u m ; 
 	 	 	 r e t u r n   n u m ; 
 	 	 } ; 
 	 	 / /   F o r m a t   a   n a m e ,   s h o r t   o r   l o n g   a s   r e q u e s t e d 
 	 	 v a r   f o r m a t N a m e   =   f u n c t i o n ( m a t c h ,   v a l u e ,   s h o r t N a m e s ,   l o n g N a m e s )   { 
 	 	 	 r e t u r n   ( l o o k A h e a d ( m a t c h )   ?   l o n g N a m e s [ v a l u e ]   :   s h o r t N a m e s [ v a l u e ] ) ; 
 	 	 } ; 
 	 	 v a r   o u t p u t   =   ' ' ; 
 	 	 v a r   l i t e r a l   =   f a l s e ; 
 	 	 i f   ( d a t e ) 
 	 	 	 f o r   ( v a r   i F o r m a t   =   0 ;   i F o r m a t   <   f o r m a t . l e n g t h ;   i F o r m a t + + )   { 
 	 	 	 	 i f   ( l i t e r a l ) 
 	 	 	 	 	 i f   ( f o r m a t . c h a r A t ( i F o r m a t )   = =   " ' "   & &   ! l o o k A h e a d ( " ' " ) ) 
 	 	 	 	 	 	 l i t e r a l   =   f a l s e ; 
 	 	 	 	 	 e l s e 
 	 	 	 	 	 	 o u t p u t   + =   f o r m a t . c h a r A t ( i F o r m a t ) ; 
 	 	 	 	 e l s e 
 	 	 	 	 	 s w i t c h   ( f o r m a t . c h a r A t ( i F o r m a t ) )   { 
 	 	 	 	 	 	 c a s e   ' d ' : 
 	 	 	 	 	 	 	 o u t p u t   + =   f o r m a t N u m b e r ( ' d ' ,   d a t e . g e t D a t e ( ) ,   2 ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   ' D ' : 
 	 	 	 	 	 	 	 o u t p u t   + =   f o r m a t N a m e ( ' D ' ,   d a t e . g e t D a y ( ) ,   d a y N a m e s S h o r t ,   d a y N a m e s ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   ' o ' : 
 	 	 	 	 	 	 	 v a r   d o y   =   d a t e . g e t D a t e ( ) ; 
 	 	 	 	 	 	 	 f o r   ( v a r   m   =   d a t e . g e t M o n t h ( )   -   1 ;   m   > =   0 ;   m - - ) 
 	 	 	 	 	 	 	 	 d o y   + =   t h i s . _ 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 ( ) ,   m ) ; 
 	 	 	 	 	 	 	 o u t p u t   + =   f o r m a t N u m b e r ( ' o ' ,   d o y ,   3 ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   ' m ' : 
 	 	 	 	 	 	 	 o u t p u t   + =   f o r m a t N u m b e r ( ' m ' ,   d a t e . g e t M o n t h ( )   +   1 ,   2 ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   ' M ' : 
 	 	 	 	 	 	 	 o u t p u t   + =   f o r m a t N a m e ( ' M ' ,   d a t e . g e t M o n t h ( ) ,   m o n t h N a m e s S h o r t ,   m o n t h N a m e s ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   ' y ' : 
 	 	 	 	 	 	 	 o u t p u t   + =   ( l o o k A h e a d ( ' y ' )   ?   d a t e . g e t F u l l Y e a r ( )   : 
 	 	 	 	 	 	 	 	 ( d a t e . g e t Y e a r ( )   %   1 0 0   <   1 0   ?   ' 0 '   :   ' ' )   +   d a t e . g e t Y e a r ( )   %   1 0 0 ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   ' @ ' : 
 	 	 	 	 	 	 	 o u t p u t   + =   d a t e . g e t T i m e ( ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   " ' " : 
 	 	 	 	 	 	 	 i f   ( l o o k A h e a d ( " ' " ) ) 
 	 	 	 	 	 	 	 	 o u t p u t   + =   " ' " ; 
 	 	 	 	 	 	 	 e l s e 
 	 	 	 	 	 	 	 	 l i t e r a l   =   t r u e ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 d e f a u l t : 
 	 	 	 	 	 	 	 o u t p u t   + =   f o r m a t . c h a r A t ( i F o r m a t ) ; 
 	 	 	 	 	 } 
 	 	 	 } 
 	 	 r e t u r n   o u t p u t ; 
 	 } , 
 
 	 / *   E x t r a c t   a l l   p o s s i b l e   c h a r a c t e r s   f r o m   t h e   d a t e   f o r m a t .   * / 
 	 _ p o s s i b l e C h a r s :   f u n c t i o n   ( f o r m a t )   { 
 	 	 v a r   c h a r s   =   ' ' ; 
 	 	 v a r   l i t e r a l   =   f a l s e ; 
 	 	 f o r   ( v a r   i F o r m a t   =   0 ;   i F o r m a t   <   f o r m a t . l e n g t h ;   i F o r m a t + + ) 
 	 	 	 i f   ( l i t e r a l ) 
 	 	 	 	 i f   ( f o r m a t . c h a r A t ( i F o r m a t )   = =   " ' "   & &   ! l o o k A h e a d ( " ' " ) ) 
 	 	 	 	 	 l i t e r a l   =   f a l s e ; 
 	 	 	 	 e l s e 
 	 	 	 	 	 c h a r s   + =   f o r m a t . c h a r A t ( i F o r m a t ) ; 
 	 	 	 e l s e 
 	 	 	 	 s w i t c h   ( f o r m a t . c h a r A t ( i F o r m a t ) )   { 
 	 	 	 	 	 c a s e   ' d ' :   c a s e   ' m ' :   c a s e   ' y ' :   c a s e   ' @ ' : 
 	 	 	 	 	 	 c h a r s   + =   ' 0 1 2 3 4 5 6 7 8 9 ' ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 c a s e   ' D ' :   c a s e   ' M ' : 
 	 	 	 	 	 	 r e t u r n   n u l l ;   / /   A c c e p t   a n y t h i n g 
 	 	 	 	 	 c a s e   " ' " : 
 	 	 	 	 	 	 i f   ( l o o k A h e a d ( " ' " ) ) 
 	 	 	 	 	 	 	 c h a r s   + =   " ' " ; 
 	 	 	 	 	 	 e l s e 
 	 	 	 	 	 	 	 l i t e r a l   =   t r u e ; 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 d e f a u l t : 
 	 	 	 	 	 	 c h a r s   + =   f o r m a t . c h a r A t ( i F o r m a t ) ; 
 	 	 	 	 } 
 	 	 r e t u r n   c h a r s ; 
 	 } , 
 
 	 / *   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 .   * / 
 	 _ 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 . s e t t i n g s [ n a m e ]   ! = =   u n d e f i n e d   ? 
 	 	 	 i n s t . s e t t i n g s [ n a m e ]   :   t h i s . _ d e f a u l t s [ n a m e ] ; 
 	 } , 
 
 	 / *   P a r s e   e x i s t i n g   d a t e   a n d   i n i t i a l i s e   d a t e   p i c k e r .   * / 
 	 _ s e t D a t e F r o m F i e l d :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   d a t e F o r m a t   =   t h i s . _ g e t ( i n s t ,   ' d a t e F o r m a t ' ) ; 
 	 	 v a r   d a t e s   =   i n s t . i n p u t   ?   i n s t . i n p u t . v a l ( )   :   n u l l ; 
 	 	 i n s t . e n d D a y   =   i n s t . e n d M o n t h   =   i n s t . e n d Y e a r   =   n u l l ; 
 	 	 v a r   d a t e   =   d e f a u l t D a t e   =   t h i s . _ g e t D e f a u l t D a t e ( i n s t ) ; 
 	 	 v a r   s e t t i n g s   =   t h i s . _ g e t F o r m a t C o n f i g ( i n s t ) ; 
 	 	 t r y   { 
 	 	 	 d a t e   =   t h i s . p a r s e D a t e ( d a t e F o r m a t ,   d a t e s ,   s e t t i n g s )   | |   d e f a u l t D a t e ; 
 	 	 }   c a t c h   ( e v e n t )   { 
 	 	 	 t h i s . l o g ( e v e n t ) ; 
 	 	 	 d a t e   =   d e f a u l t D a t e ; 
 	 	 } 
 	 	 i n s t . s e l e c t e d D a y   =   d a t e . g e t D a t e ( ) ; 
 	 	 i n s t . d r a w M o n t h   =   i n s t . s e l e c t e d M o n t h   =   d a t e . g e t M o n t h ( ) ; 
 	 	 i n s t . d r a w Y e a r   =   i n s t . s e l e c t e d Y e a r   =   d a t e . g e t F u l l Y e a r ( ) ; 
 	 	 i n s t . c u r r e n t D a y   =   ( d a t e s   ?   d a t e . g e t D a t e ( )   :   0 ) ; 
 	 	 i n s t . c u r r e n t M o n t h   =   ( d a t e s   ?   d a t e . g e t M o n t h ( )   :   0 ) ; 
 	 	 i n s t . c u r r e n t Y e a r   =   ( d a t e s   ?   d a t e . g e t F u l l Y e a r ( )   :   0 ) ; 
 	 	 t h i s . _ a d j u s t I n s t D a t e ( i n s t ) ; 
 	 } , 
 
 	 / *   R e t r i e v e   t h e   d e f a u l t   d a t e   s h o w n   o n   o p e n i n g .   * / 
 	 _ g e t D e f a u l t D a t e :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   d a t e   =   t h i s . _ d e t e r m i n e D a t e ( t h i s . _ g e t ( i n s t ,   ' d e f a u l t D a t e ' ) ,   n e w   D a t e ( ) ) ; 
 	 	 v a r   m i n D a t e   =   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m i n ' ,   t r u e ) ; 
 	 	 v a r   m a x D a t e   =   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m a x ' ) ; 
 	 	 d a t e   =   ( m i n D a t e   & &   d a t e   <   m i n D a t e   ?   m i n D a t e   :   d a t e ) ; 
 	 	 d a t e   =   ( m a x D a t e   & &   d a t e   >   m a x D a t e   ?   m a x D a t e   :   d a t e ) ; 
 	 	 r e t u r n   d a t e ; 
 	 } , 
 
 	 / *   A   d a t 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 .   * / 
 	 _ d e t e r m i n e D a t e :   f u n c t i o n ( d a t e ,   d e f a u l t D a t 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 )   { 
 	 	 	 v a r   d a t e   =   n e w   D a t e ( ) ; 
 	 	 	 d a t e . s e t D a t e ( d a t e . g e t D a t e ( )   +   o f f s e t ) ; 
 	 	 	 r e t u r n   d a t 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 ,   g e t D a y s I n M o n t h )   { 
 	 	 	 v a r   d a t e   =   n e w   D a t e ( ) ; 
 	 	 	 v a r   y e a r   =   d a t e . g e t F u l l Y e a r ( ) ; 
 	 	 	 v a r   m o n t h   =   d a t e . g e t M o n t h ( ) ; 
 	 	 	 v a r   d a y   =   d a t e . g e t D a t e ( ) ; 
 	 	 	 v a r   p a t t e r n   =   / ( [ + - ] ? [ 0 - 9 ] + ) \ s * ( d | D | w | W | m | M | y | 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 ]   | |   ' d ' )   { 
 	 	 	 	 	 c a s e   ' d '   :   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 '   :   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   ' m '   :   c a s e   ' M '   : 
 	 	 	 	 	 	 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 ,   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 ' :   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 ,   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 ) ; 
 	 	 } ; 
 	 	 d a t e   =   ( d a t e   = =   n u l l   ?   d e f a u l t D a t e   : 
 	 	 	 ( t y p e o f   d a t e   = =   ' s t r i n g '   ?   o f f s e t S t r i n g ( d a t e ,   t h i s . _ g e t D a y s I n M o n t h )   : 
 	 	 	 ( t y p e o f   d a t e   = =   ' n u m b e r '   ?   ( i s N a N ( d a t e )   ?   d e f a u l t D a t e   :   o f f s e t N u m e r i c ( d a t e ) )   :   d a t e ) ) ) ; 
 	 	 d a t e   =   ( d a t e   & &   d a t e . t o S t r i n g ( )   = =   ' I n v a l i d   D a t e '   ?   d e f a u l t D a t e   :   d a t e ) ; 
 	 	 i f   ( d a t e )   { 
 	 	 	 d a t e . s e t H o u r s ( 0 ) ; 
 	 	 	 d a t e . s e t M i n u t e s ( 0 ) ; 
 	 	 	 d a t e . s e t S e c o n d s ( 0 ) ; 
 	 	 	 d a t e . s e t M i l l i s e c o n d s ( 0 ) ; 
 	 	 } 
 	 	 r e t u r n   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( d a t e ) ; 
 	 } , 
 
 	 / *   H a n d l e   s w i t c h   t o / f r o m   d a y l i g h t   s a v i n g . 
 	       H o u r s   m a y   b e   n o n - z e r o   o n   d a y l i g h t   s a v i n g   c u t - o v e r : 
 	       >   1 2   w h e n   m i d n i g h t   c h a n g e o v e r ,   b u t   t h e n   c a n n o t   g e n e r a t e 
 	       m i d n i g h t   d a t e t i m e ,   s o   j u m p   t o   1 A M ,   o t h e r w i s e   r e s e t . 
 	       @ p a r a m     d a t e     ( D a t e )   t h e   d a t e   t o   c h e c k 
 	       @ r e t u r n     ( D a t e )   t h e   c o r r e c t e d   d a t e   * / 
 	 _ d a y l i g h t S a v i n g A d j u s t :   f u n c t i o n ( d a t e )   { 
 	 	 i f   ( ! d a t e )   r e t u r n   n u l l ; 
 	 	 d a t e . s e t H o u r s ( d a t e . g e t H o u r s ( )   >   1 2   ?   d a t e . g e t H o u r s ( )   +   2   :   0 ) ; 
 	 	 r e t u r n   d a t e ; 
 	 } , 
 
 	 / *   S e t   t h e   d a t e ( s )   d i r e c t l y .   * / 
 	 _ s e t D a t e :   f u n c t i o n ( i n s t ,   d a t e ,   e n d D a t e )   { 
 	 	 v a r   c l e a r   =   ! ( d a t e ) ; 
 	 	 v a r   o r i g M o n t h   =   i n s t . s e l e c t e d M o n t h ; 
 	 	 v a r   o r i g Y e a r   =   i n s t . s e l e c t e d Y e a r ; 
 	 	 d a t e   =   t h i s . _ d e t e r m i n e D a t e ( d a t e ,   n e w   D a t e ( ) ) ; 
 	 	 i n s t . s e l e c t e d D a y   =   i n s t . c u r r e n t D a y   =   d a t e . g e t D a t e ( ) ; 
 	 	 i n s t . d r a w M o n t h   =   i n s t . s e l e c t e d M o n t h   =   i n s t . c u r r e n t M o n t h   =   d a t e . g e t M o n t h ( ) ; 
 	 	 i n s t . d r a w Y e a r   =   i n s t . s e l e c t e d Y e a r   =   i n s t . c u r r e n t Y e a r   =   d a t e . g e t F u l l Y e a r ( ) ; 
 	 	 i f   ( o r i g M o n t h   ! =   i n s t . s e l e c t e d M o n t h   | |   o r i g Y e a r   ! =   i n s t . s e l e c t e d Y e a r ) 
 	 	 	 t h i s . _ n o t i f y C h a n g e ( i n s t ) ; 
 	 	 t h i s . _ a d j u s t I n s t D a t e ( i n s t ) ; 
 	 	 i f   ( i n s t . i n p u t )   { 
 	 	 	 i n s t . i n p u t . v a l ( c l e a r   ?   ' '   :   t h i s . _ f o r m a t D a t e ( i n s t ) ) ; 
 	 	 } 
 	 } , 
 
 	 / *   R e t r i e v e   t h e   d a t e ( s )   d i r e c t l y .   * / 
 	 _ g e t D a t e :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   s t a r t D a t e   =   ( ! i n s t . c u r r e n t Y e a r   | |   ( i n s t . i n p u t   & &   i n s t . i n p u t . v a l ( )   = =   ' ' )   ?   n u l l   : 
 	 	 	 t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( 
 	 	 	 i n s t . c u r r e n t Y e a r ,   i n s t . c u r r e n t M o n t h ,   i n s t . c u r r e n t D a y ) ) ) ; 
 	 	 	 r e t u r n   s t a r t D a t e ; 
 	 } , 
 
 	 / *   G e n e r a t e   t h e   H T M L   f o r   t h e   c u r r e n t   s t a t e   o f   t h e   d a t e   p i c k e r .   * / 
 	 _ g e n e r a t e H T M L :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   t o d a y   =   n e w   D a t e ( ) ; 
 	 	 t o d a y   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( 
 	 	 	 n e w   D a t e ( t o d a y . g e t F u l l Y e a r ( ) ,   t o d a y . g e t M o n t h ( ) ,   t o d a y . g e t D a t e ( ) ) ) ;   / /   c l e a r   t i m e 
 	 	 v a r   i s R T L   =   t h i s . _ g e t ( i n s t ,   ' i s R T L ' ) ; 
 	 	 v a r   s h o w B u t t o n P a n e l   =   t h i s . _ g e t ( i n s t ,   ' s h o w B u t t o n P a n e l ' ) ; 
 	 	 v a r   h i d e I f N o P r e v N e x t   =   t h i s . _ g e t ( i n s t ,   ' h i d e I f N o P r e v N e x t ' ) ; 
 	 	 v a r   n a v i g a t i o n A s D a t e F o r m a t   =   t h i s . _ g e t ( i n s t ,   ' n a v i g a t i o n A s D a t e F o r m a t ' ) ; 
 	 	 v a r   n u m M o n t h s   =   t h i s . _ g e t N u m b e r O f M o n t h s ( i n s t ) ; 
 	 	 v a r   s h o w C u r r e n t A t P o s   =   t h i s . _ g e t ( i n s t ,   ' s h o w C u r r e n t A t P o s ' ) ; 
 	 	 v a r   s t e p M o n t h s   =   t h i s . _ g e t ( i n s t ,   ' s t e p M o n t h s ' ) ; 
 	 	 v a r   s t e p B i g M o n t h s   =   t h i s . _ g e t ( i n s t ,   ' s t e p B i g M o n t h s ' ) ; 
 	 	 v a r   i s M u l t i M o n t h   =   ( n u m M o n t h s [ 0 ]   ! =   1   | |   n u m M o n t h s [ 1 ]   ! =   1 ) ; 
 	 	 v a r   c u r r e n t D a t e   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( ( ! i n s t . c u r r e n t D a y   ?   n e w   D a t e ( 9 9 9 9 ,   9 ,   9 )   : 
 	 	 	 n e w   D a t e ( i n s t . c u r r e n t Y e a r ,   i n s t . c u r r e n t M o n t h ,   i n s t . c u r r e n t D a y ) ) ) ; 
 	 	 v a r   m i n D a t e   =   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m i n ' ,   t r u e ) ; 
 	 	 v a r   m a x D a t e   =   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m a x ' ) ; 
 	 	 v a r   d r a w M o n t h   =   i n s t . d r a w M o n t h   -   s h o w C u r r e n t A t P o s ; 
 	 	 v a r   d r a w Y e a r   =   i n s t . d r a w Y e a r ; 
 	 	 i f   ( d r a w M o n t h   <   0 )   { 
 	 	 	 d r a w M o n t h   + =   1 2 ; 
 	 	 	 d r a w Y e a r - - ; 
 	 	 } 
 	 	 i f   ( m a x D a t e )   { 
 	 	 	 v a r   m a x D r a w   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( m a x D a t e . g e t F u l l Y e a r ( ) , 
 	 	 	 	 m a x D a t e . g e t M o n t h ( )   -   n u m M o n t h s [ 1 ]   +   1 ,   m a x D a t e . g e t D a t e ( ) ) ) ; 
 	 	 	 m a x D r a w   =   ( m i n D a t e   & &   m a x D r a w   <   m i n D a t e   ?   m i n D a t e   :   m a x D r a w ) ; 
 	 	 	 w h i l e   ( t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( d r a w Y e a r ,   d r a w M o n t h ,   1 ) )   >   m a x D r a w )   { 
 	 	 	 	 d r a w M o n t h - - ; 
 	 	 	 	 i f   ( d r a w M o n t h   <   0 )   { 
 	 	 	 	 	 d r a w M o n t h   =   1 1 ; 
 	 	 	 	 	 d r a w Y e a r - - ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 	 i n s t . d r a w M o n t h   =   d r a w M o n t h ; 
 	 	 i n s t . d r a w Y e a r   =   d r a w Y e a r ; 
 	 	 v a r   p r e v T e x t   =   t h i s . _ g e t ( i n s t ,   ' p r e v T e x t ' ) ; 
 	 	 p r e v T e x t   =   ( ! n a v i g a t i o n A s D a t e F o r m a t   ?   p r e v T e x t   :   t h i s . f o r m a t D a t e ( p r e v T e x t , 
 	 	 	 t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( d r a w Y e a r ,   d r a w M o n t h   -   s t e p M o n t h s ,   1 ) ) , 
 	 	 	 t h i s . _ g e t F o r m a t C o n f i g ( i n s t ) ) ) ; 
 	 	 v a r   p r e v   =   ( t h i s . _ c a n A d j u s t M o n t h ( i n s t ,   - 1 ,   d r a w Y e a r ,   d r a w M o n t h )   ? 
 	 	 	 ' < a   c l a s s = " u i - d a t e p i c k e r - p r e v   u i - c o r n e r - a l l "   o n c l i c k = " D P _ j Q u e r y . d a t e p i c k e r . _ a d j u s t D a t e ( \ ' # '   +   i n s t . i d   +   ' \ ' ,   - '   +   s t e p M o n t h s   +   ' ,   \ ' M \ ' ) ; " '   + 
 	 	 	 '   t i t l e = " '   +   p r e v T e x t   +   ' " > < s p a n   c l a s s = " u i - i c o n   u i - i c o n - c i r c l e - t r i a n g l e - '   +   (   i s R T L   ?   ' e '   :   ' w ' )   +   ' " > '   +   p r e v T e x t   +   ' < / s p a n > < / a > '   : 
 	 	 	 ( h i d e I f N o P r e v N e x t   ?   ' '   :   ' < a   c l a s s = " u i - d a t e p i c k e r - p r e v   u i - c o r n e r - a l l   u i - s t a t e - d i s a b l e d "   t i t l e = " ' +   p r e v T e x t   + ' " > < s p a n   c l a s s = " u i - i c o n   u i - i c o n - c i r c l e - t r i a n g l e - '   +   (   i s R T L   ?   ' e '   :   ' w ' )   +   ' " > '   +   p r e v T e x t   +   ' < / s p a n > < / a > ' ) ) ; 
 	 	 v a r   n e x t T e x t   =   t h i s . _ g e t ( i n s t ,   ' n e x t T e x t ' ) ; 
 	 	 n e x t T e x t   =   ( ! n a v i g a t i o n A s D a t e F o r m a t   ?   n e x t T e x t   :   t h i s . f o r m a t D a t e ( n e x t T e x t , 
 	 	 	 t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( d r a w Y e a r ,   d r a w M o n t h   +   s t e p M o n t h s ,   1 ) ) , 
 	 	 	 t h i s . _ g e t F o r m a t C o n f i g ( i n s t ) ) ) ; 
 	 	 v a r   n e x t   =   ( t h i s . _ c a n A d j u s t M o n t h ( i n s t ,   + 1 ,   d r a w Y e a r ,   d r a w M o n t h )   ? 
 	 	 	 ' < a   c l a s s = " u i - d a t e p i c k e r - n e x t   u i - c o r n e r - a l l "   o n c l i c k = " D P _ j Q u e r y . d a t e p i c k e r . _ a d j u s t D a t e ( \ ' # '   +   i n s t . i d   +   ' \ ' ,   + '   +   s t e p M o n t h s   +   ' ,   \ ' M \ ' ) ; " '   + 
 	 	 	 '   t i t l e = " '   +   n e x t T e x t   +   ' " > < s p a n   c l a s s = " u i - i c o n   u i - i c o n - c i r c l e - t r i a n g l e - '   +   (   i s R T L   ?   ' w '   :   ' e ' )   +   ' " > '   +   n e x t T e x t   +   ' < / s p a n > < / a > '   : 
 	 	 	 ( h i d e I f N o P r e v N e x t   ?   ' '   :   ' < a   c l a s s = " u i - d a t e p i c k e r - n e x t   u i - c o r n e r - a l l   u i - s t a t e - d i s a b l e d "   t i t l e = " ' +   n e x t T e x t   +   ' " > < s p a n   c l a s s = " u i - i c o n   u i - i c o n - c i r c l e - t r i a n g l e - '   +   (   i s R T L   ?   ' w '   :   ' e ' )   +   ' " > '   +   n e x t T e x t   +   ' < / s p a n > < / a > ' ) ) ; 
 	 	 v a r   c u r r e n t T e x t   =   t h i s . _ g e t ( i n s t ,   ' c u r r e n t T e x t ' ) ; 
 	 	 v a r   g o t o D a t e   =   ( t h i s . _ g e t ( i n s t ,   ' g o t o C u r r e n t ' )   & &   i n s t . c u r r e n t D a y   ?   c u r r e n t D a t e   :   t o d a y ) ; 
 	 	 c u r r e n t T e x t   =   ( ! n a v i g a t i o n A s D a t e F o r m a t   ?   c u r r e n t T e x t   : 
 	 	 	 t h i s . f o r m a t D a t e ( c u r r e n t T e x t ,   g o t o D a t e ,   t h i s . _ g e t F o r m a t C o n f i g ( i n s t ) ) ) ; 
 	 	 v a r   c o n t r o l s   =   ( ! i n s t . i n l i n e   ?   ' < b u t t o n   t y p e = " b u t t o n "   c l a s s = " u i - d a t e p i c k e r - c l o s e   u i - s t a t e - d e f a u l t   u i - p r i o r i t y - p r i m a r y   u i - c o r n e r - a l l "   o n c l i c k = " D P _ j Q u e r y . d a t e p i c k e r . _ h i d e D a t e p i c k e r ( ) ; " > '   +   t h i s . _ g e t ( i n s t ,   ' c l o s e T e x t ' )   +   ' < / b u t t o n > '   :   ' ' ) ; 
 	 	 v a r   b u t t o n P a n e l   =   ( s h o w B u t t o n P a n e l )   ?   ' < d i v   c l a s s = " u i - d a t e p i c k e r - b u t t o n p a n e   u i - w i d g e t - c o n t e n t " > '   +   ( i s R T L   ?   c o n t r o l s   :   ' ' )   + 
 	 	 	 ( t h i s . _ i s I n R a n g e ( i n s t ,   g o t o D a t e )   ?   ' < b u t t o n   t y p e = " b u t t o n "   c l a s s = " u i - d a t e p i c k e r - c u r r e n t   u i - s t a t e - d e f a u l t   u i - p r i o r i t y - s e c o n d a r y   u i - c o r n e r - a l l "   o n c l i c k = " D P _ j Q u e r y . d a t e p i c k e r . _ g o t o T o d a y ( \ ' # '   +   i n s t . i d   +   ' \ ' ) ; " '   + 
 	 	 	 ' > '   +   c u r r e n t T e x t   +   ' < / b u t t o n > '   :   ' ' )   +   ( i s R T L   ?   ' '   :   c o n t r o l s )   +   ' < / d i v > '   :   ' ' ; 
 	 	 v a r   f i r s t D a y   =   p a r s e I n t ( t h i s . _ g e t ( i n s t ,   ' f i r s t D a y ' ) , 1 0 ) ; 
 	 	 f i r s t D a y   =   ( i s N a N ( f i r s t D a y )   ?   0   :   f i r s t D a y ) ; 
 	 	 v a r   d a y N a m e s   =   t h i s . _ g e t ( i n s t ,   ' d a y N a m e s ' ) ; 
 	 	 v a r   d a y N a m e s S h o r t   =   t h i s . _ g e t ( i n s t ,   ' d a y N a m e s S h o r t ' ) ; 
 	 	 v a r   d a y N a m e s M i n   =   t h i s . _ g e t ( i n s t ,   ' d a y N a m e s M i n ' ) ; 
 	 	 v a r   m o n t h N a m e s   =   t h i s . _ g e t ( i n s t ,   ' m o n t h N a m e s ' ) ; 
 	 	 v a r   m o n t h N a m e s S h o r t   =   t h i s . _ g e t ( i n s t ,   ' m o n t h N a m e s S h o r t ' ) ; 
 	 	 v a r   b e f o r e S h o w D a y   =   t h i s . _ g e t ( i n s t ,   ' b e f o r e S h o w D a y ' ) ; 
 	 	 v a r   s h o w O t h e r M o n t h s   =   t h i s . _ g e t ( i n s t ,   ' s h o w O t h e r M o n t h s ' ) ; 
 	 	 v a r   c a l c u l a t e W e e k   =   t h i s . _ g e t ( i n s t ,   ' c a l c u l a t e W e e k ' )   | |   t h i s . i s o 8 6 0 1 W e e k ; 
 	 	 v a r   e n d D a t e   =   i n s t . e n d D a y   ?   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( 
 	 	 	 n e w   D a t e ( i n s t . e n d Y e a r ,   i n s t . e n d M o n t h ,   i n s t . e n d D a y ) )   :   c u r r e n t D a t e ; 
 	 	 v a r   d e f a u l t D a t e   =   t h i s . _ g e t D e f a u l t D a t e ( i n s t ) ; 
 	 	 v a r   h t m l   =   ' ' ; 
 	 	 f o r   ( v a r   r o w   =   0 ;   r o w   <   n u m M o n t h s [ 0 ] ;   r o w + + )   { 
 	 	 	 v a r   g r o u p   =   ' ' ; 
 	 	 	 f o r   ( v a r   c o l   =   0 ;   c o l   <   n u m M o n t h s [ 1 ] ;   c o l + + )   { 
 	 	 	 	 v a r   s e l e c t e d D a t e   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( d r a w Y e a r ,   d r a w M o n t h ,   i n s t . s e l e c t e d D a y ) ) ; 
 	 	 	 	 v a r   c o r n e r C l a s s   =   '   u i - c o r n e r - a l l ' ; 
 	 	 	 	 v a r   c a l e n d e r   =   ' ' ; 
 	 	 	 	 i f   ( i s M u l t i M o n t h )   { 
 	 	 	 	 	 c a l e n d e r   + =   ' < d i v   c l a s s = " u i - d a t e p i c k e r - g r o u p   u i - d a t e p i c k e r - g r o u p - ' ; 
 	 	 	 	 	 s w i t c h   ( c o l )   { 
 	 	 	 	 	 	 c a s e   0 :   c a l e n d e r   + =   ' f i r s t ' ;   c o r n e r C l a s s   =   '   u i - c o r n e r - '   +   ( i s R T L   ?   ' r i g h t '   :   ' l e f t ' ) ;   b r e a k ; 
 	 	 	 	 	 	 c a s e   n u m M o n t h s [ 1 ] - 1 :   c a l e n d e r   + =   ' l a s t ' ;   c o r n e r C l a s s   =   '   u i - c o r n e r - '   +   ( i s R T L   ?   ' l e f t '   :   ' r i g h t ' ) ;   b r e a k ; 
 	 	 	 	 	 	 d e f a u l t :   c a l e n d e r   + =   ' m i d d l e ' ;   c o r n e r C l a s s   =   ' ' ;   b r e a k ; 
 	 	 	 	 	 } 
 	 	 	 	 	 c a l e n d e r   + =   ' " > ' ; 
 	 	 	 	 } 
 	 	 	 	 c a l e n d e r   + =   ' < d i v   c l a s s = " u i - d a t e p i c k e r - h e a d e r   u i - w i d g e t - h e a d e r   u i - h e l p e r - c l e a r f i x '   +   c o r n e r C l a s s   +   ' " > '   + 
 	 	 	 	 	 ( / a l l | l e f t / . t e s t ( c o r n e r C l a s s )   & &   r o w   = =   0   ?   ( i s R T L   ?   n e x t   :   p r e v )   :   ' ' )   + 
 	 	 	 	 	 ( / a l l | r i g h t / . t e s t ( c o r n e r C l a s s )   & &   r o w   = =   0   ?   ( i s R T L   ?   p r e v   :   n e x t )   :   ' ' )   + 
 	 	 	 	 	 t h i s . _ g e n e r a t e M o n t h Y e a r H e a d e r ( i n s t ,   d r a w M o n t h ,   d r a w Y e a r ,   m i n D a t e ,   m a x D a t e , 
 	 	 	 	 	 s e l e c t e d D a t e ,   r o w   >   0   | |   c o l   >   0 ,   m o n t h N a m e s ,   m o n t h N a m e s S h o r t )   +   / /   d r a w   m o n t h   h e a d e r s 
 	 	 	 	 	 ' < / d i v > < t a b l e   c l a s s = " u i - d a t e p i c k e r - c a l e n d a r " > < t h e a d > '   + 
 	 	 	 	 	 ' < t r > ' ; 
 	 	 	 	 v a r   t h e a d   =   ' ' ; 
 	 	 	 	 f o r   ( v a r   d o w   =   0 ;   d o w   <   7 ;   d o w + + )   {   / /   d a y s   o f   t h e   w e e k 
 	 	 	 	 	 v a r   d a y   =   ( d o w   +   f i r s t D a y )   %   7 ; 
 	 	 	 	 	 t h e a d   + =   ' < t h '   +   ( ( d o w   +   f i r s t D a y   +   6 )   %   7   > =   5   ?   '   c l a s s = " u i - d a t e p i c k e r - w e e k - e n d " '   :   ' ' )   +   ' > '   + 
 	 	 	 	 	 	 ' < s p a n   t i t l e = " '   +   d a y N a m e s [ d a y ]   +   ' " > '   +   d a y N a m e s M i n [ d a y ]   +   ' < / s p a n > < / t h > ' ; 
 	 	 	 	 } 
 	 	 	 	 c a l e n d e r   + =   t h e a d   +   ' < / t r > < / t h e a d > < t b o d y > ' ; 
 	 	 	 	 v a r   d a y s I n M o n t h   =   t h i s . _ g e t D a y s I n M o n t h ( d r a w Y e a r ,   d r a w M o n t h ) ; 
 	 	 	 	 i f   ( d r a w Y e a r   = =   i n s t . s e l e c t e d Y e a r   & &   d r a w M o n t h   = =   i n s t . s e l e c t e d M o n t h ) 
 	 	 	 	 	 i n s t . s e l e c t e d D a y   =   M a t h . m i n ( i n s t . s e l e c t e d D a y ,   d a y s I n M o n t h ) ; 
 	 	 	 	 v a r   l e a d D a y s   =   ( t h i s . _ g e t F i r s t D a y O f M o n t h ( d r a w Y e a r ,   d r a w M o n t h )   -   f i r s t D a y   +   7 )   %   7 ; 
 	 	 	 	 v a r   n u m R o w s   =   ( i s M u l t i M o n t h   ?   6   :   M a t h . c e i l ( ( l e a d D a y s   +   d a y s I n M o n t h )   /   7 ) ) ;   / /   c a l c u l a t e   t h e   n u m b e r   o f   r o w s   t o   g e n e r a t e 
 	 	 	 	 v a r   p r i n t D a t e   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( d r a w Y e a r ,   d r a w M o n t h ,   1   -   l e a d D a y s ) ) ; 
 	 	 	 	 f o r   ( v a r   d R o w   =   0 ;   d R o w   <   n u m R o w s ;   d R o w + + )   {   / /   c r e a t e   d a t e   p i c k e r   r o w s 
 	 	 	 	 	 c a l e n d e r   + =   ' < t r > ' ; 
 	 	 	 	 	 v a r   t b o d y   =   ' ' ; 
 	 	 	 	 	 f o r   ( v a r   d o w   =   0 ;   d o w   <   7 ;   d o w + + )   {   / /   c r e a t e   d a t e   p i c k e r   d a y s 
 	 	 	 	 	 	 v a r   d a y S e t t i n g s   =   ( b e f o r e S h o w D a y   ? 
 	 	 	 	 	 	 	 b e f o r e S h o w D a y . a p p l y ( ( i n s t . i n p u t   ?   i n s t . i n p u t [ 0 ]   :   n u l l ) ,   [ p r i n t D a t e ] )   :   [ t r u e ,   ' ' ] ) ; 
 	 	 	 	 	 	 v a r   o t h e r M o n t h   =   ( p r i n t D a t e . g e t M o n t h ( )   ! =   d r a w M o n t h ) ; 
 	 	 	 	 	 	 v a r   u n s e l e c t a b l e   =   o t h e r M o n t h   | |   ! d a y S e t t i n g s [ 0 ]   | | 
 	 	 	 	 	 	 	 ( m i n D a t e   & &   p r i n t D a t e   <   m i n D a t e )   | |   ( m a x D a t e   & &   p r i n t D a t e   >   m a x D a t e ) ; 
 	 	 	 	 	 	 t b o d y   + =   ' < t d   c l a s s = " '   + 
 	 	 	 	 	 	 	 ( ( d o w   +   f i r s t D a y   +   6 )   %   7   > =   5   ?   '   u i - d a t e p i c k e r - w e e k - e n d '   :   ' ' )   +   / /   h i g h l i g h t   w e e k e n d s 
 	 	 	 	 	 	 	 ( o t h e r M o n t h   ?   '   u i - d a t e p i c k e r - o t h e r - m o n t h '   :   ' ' )   +   / /   h i g h l i g h t   d a y s   f r o m   o t h e r   m o n t h s 
 	 	 	 	 	 	 	 ( ( p r i n t D a t e . g e t T i m e ( )   = =   s e l e c t e d D a t e . g e t T i m e ( )   & &   d r a w M o n t h   = =   i n s t . s e l e c t e d M o n t h   & &   i n s t . _ k e y E v e n t )   | |   / /   u s e r   p r e s s e d   k e y 
 	 	 	 	 	 	 	 ( d e f a u l t D a t e . g e t T i m e ( )   = =   p r i n t D a t e . g e t T i m e ( )   & &   d e f a u l t D a t e . g e t T i m e ( )   = =   s e l e c t e d D a t e . g e t T i m e ( ) )   ? 
 	 	 	 	 	 	 	 / /   o r   d e f a u l t D a t e   i s   c u r r e n t   p r i n t e d D a t e   a n d   d e f a u l t D a t e   i s   s e l e c t e d D a t e 
 	 	 	 	 	 	 	 '   '   +   t h i s . _ d a y O v e r C l a s s   :   ' ' )   +   / /   h i g h l i g h t   s e l e c t e d   d a y 
 	 	 	 	 	 	 	 ( u n s e l e c t a b l e   ?   '   '   +   t h i s . _ u n s e l e c t a b l e C l a s s   +   '   u i - s t a t e - d i s a b l e d ' :   ' ' )   +     / /   h i g h l i g h t   u n s e l e c t a b l e   d a y s 
 	 	 	 	 	 	 	 ( o t h e r M o n t h   & &   ! s h o w O t h e r M o n t h s   ?   ' '   :   '   '   +   d a y S e t t i n g s [ 1 ]   +   / /   h i g h l i g h t   c u s t o m   d a t e s 
 	 	 	 	 	 	 	 ( p r i n t D a t e . g e t T i m e ( )   > =   c u r r e n t D a t e . g e t T i m e ( )   & &   p r i n t D a t e . g e t T i m e ( )   < =   e n d D a t e . g e t T i m e ( )   ?   / /   i n   c u r r e n t   r a n g e 
 	 	 	 	 	 	 	 '   '   +   t h i s . _ c u r r e n t C l a s s   :   ' ' )   +   / /   h i g h l i g h t   s e l e c t e d   d a y 
 	 	 	 	 	 	 	 ( p r i n t D a t e . g e t T i m e ( )   = =   t o d a y . g e t T i m e ( )   ?   '   u i - d a t e p i c k e r - t o d a y '   :   ' ' ) )   +   ' " '   +   / /   h i g h l i g h t   t o d a y   ( i f   d i f f e r e n t ) 
 	 	 	 	 	 	 	 ( ( ! o t h e r M o n t h   | |   s h o w O t h e r M o n t h s )   & &   d a y S e t t i n g s [ 2 ]   ?   '   t i t l e = " '   +   d a y S e t t i n g s [ 2 ]   +   ' " '   :   ' ' )   +   / /   c e l l   t i t l e 
 	 	 	 	 	 	 	 ( u n s e l e c t a b l e   ?   ' '   :   '   o n c l i c k = " D P _ j Q u e r y . d a t e p i c k e r . _ s e l e c t D a y ( \ ' # '   + 
 	 	 	 	 	 	 	 i n s t . i d   +   ' \ ' , '   +   d r a w M o n t h   +   ' , '   +   d r a w Y e a r   +   ' ,   t h i s ) ; r e t u r n   f a l s e ; " ' )   +   ' > '   +   / /   a c t i o n s 
 	 	 	 	 	 	 	 ( o t h e r M o n t h   ?   ( s h o w O t h e r M o n t h s   ?   p r i n t D a t e . g e t D a t e ( )   :   ' & # x a 0 ; ' )   :   / /   d i s p l a y   f o r   o t h e r   m o n t h s 
 	 	 	 	 	 	 	 ( u n s e l e c t a b l e   ?   ' < s p a n   c l a s s = " u i - s t a t e - d e f a u l t " > '   +   p r i n t D a t e . g e t D a t e ( )   +   ' < / s p a n > '   :   ' < a   c l a s s = " u i - s t a t e - d e f a u l t '   + 
 	 	 	 	 	 	 	 ( p r i n t D a t e . g e t T i m e ( )   = =   t o d a y . g e t T i m e ( )   ?   '   u i - s t a t e - h i g h l i g h t '   :   ' ' )   + 
 	 	 	 	 	 	 	 ( p r i n t D a t e . g e t T i m e ( )   > =   c u r r e n t D a t e . g e t T i m e ( )   & &   p r i n t D a t e . g e t T i m e ( )   < =   e n d D a t e . g e t T i m e ( )   ?   / /   i n   c u r r e n t   r a n g e 
 	 	 	 	 	 	 	 '   u i - s t a t e - a c t i v e '   :   ' ' )   +   / /   h i g h l i g h t   s e l e c t e d   d a y 
 	 	 	 	 	 	 	 ' "   h r e f = " # " > '   +   p r i n t D a t e . g e t D a t e ( )   +   ' < / a > ' ) )   +   ' < / t d > ' ;   / /   d i s p l a y   f o r   t h i s   m o n t h 
 	 	 	 	 	 	 p r i n t D a t e . s e t D a t e ( p r i n t D a t e . g e t D a t e ( )   +   1 ) ; 
 	 	 	 	 	 	 p r i n t D a t e   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( p r i n t D a t e ) ; 
 	 	 	 	 	 } 
 	 	 	 	 	 c a l e n d e r   + =   t b o d y   +   ' < / t r > ' ; 
 	 	 	 	 } 
 	 	 	 	 d r a w M o n t h + + ; 
 	 	 	 	 i f   ( d r a w M o n t h   >   1 1 )   { 
 	 	 	 	 	 d r a w M o n t h   =   0 ; 
 	 	 	 	 	 d r a w Y e a r + + ; 
 	 	 	 	 } 
 	 	 	 	 c a l e n d e r   + =   ' < / t b o d y > < / t a b l e > '   +   ( i s M u l t i M o n t h   ?   ' < / d i v > '   +   
 	 	 	 	 	 	 	 ( ( n u m M o n t h s [ 0 ]   >   0   & &   c o l   = =   n u m M o n t h s [ 1 ] - 1 )   ?   ' < d i v   c l a s s = " u i - d a t e p i c k e r - r o w - b r e a k " > < / d i v > '   :   ' ' )   :   ' ' ) ; 
 	 	 	 	 g r o u p   + =   c a l e n d e r ; 
 	 	 	 } 
 	 	 	 h t m l   + =   g r o u p ; 
 	 	 } 
 	 	 h t m l   + =   b u t t o n P a n e l   +   ( $ . b r o w s e r . m s i e   & &   p a r s e I n t ( $ . b r o w s e r . v e r s i o n , 1 0 )   <   7   & &   ! i n s t . i n l i n e   ? 
 	 	 	 ' < i f r a m e   s r c = " j a v a s c r i p t : f a l s e ; "   c l a s s = " u i - d a t e p i c k e r - c o v e r "   f r a m e b o r d e r = " 0 " > < / i f r a m e > '   :   ' ' ) ; 
 	 	 i n s t . _ k e y E v e n t   =   f a l s e ; 
 	 	 r e t u r n   h t m l ; 
 	 } , 
 
 	 / *   G e n e r a t e   t h e   m o n t h   a n d   y e a r   h e a d e r .   * / 
 	 _ g e n e r a t e M o n t h Y e a r H e a d e r :   f u n c t i o n ( i n s t ,   d r a w M o n t h ,   d r a w Y e a r ,   m i n D a t e ,   m a x D a t e , 
 	 	 	 s e l e c t e d D a t e ,   s e c o n d a r y ,   m o n t h N a m e s ,   m o n t h N a m e s S h o r t )   { 
 	 	 m i n D a t e   =   ( i n s t . r a n g e S t a r t   & &   m i n D a t e   & &   s e l e c t e d D a t e   <   m i n D a t e   ?   s e l e c t e d D a t e   :   m i n D a t e ) ; 
 	 	 v a r   c h a n g e M o n t h   =   t h i s . _ g e t ( i n s t ,   ' c h a n g e M o n t h ' ) ; 
 	 	 v a r   c h a n g e Y e a r   =   t h i s . _ g e t ( i n s t ,   ' c h a n g e Y e a r ' ) ; 
 	 	 v a r   s h o w M o n t h A f t e r Y e a r   =   t h i s . _ g e t ( i n s t ,   ' s h o w M o n t h A f t e r Y e a r ' ) ; 
 	 	 v a r   h t m l   =   ' < d i v   c l a s s = " u i - d a t e p i c k e r - t i t l e " > ' ; 
 	 	 v a r   m o n t h H t m l   =   ' ' ; 
 	 	 / /   m o n t h   s e l e c t i o n 
 	 	 i f   ( s e c o n d a r y   | |   ! c h a n g e M o n t h ) 
 	 	 	 m o n t h H t m l   + =   ' < s p a n   c l a s s = " u i - d a t e p i c k e r - m o n t h " > '   +   m o n t h N a m e s [ d r a w M o n t h ]   +   ' < / s p a n >   ' ; 
 	 	 e l s e   { 
 	 	 	 v a r   i n M i n Y e a r   =   ( m i n D a t e   & &   m i n D a t e . g e t F u l l Y e a r ( )   = =   d r a w Y e a r ) ; 
 	 	 	 v a r   i n M a x Y e a r   =   ( m a x D a t e   & &   m a x D a t e . g e t F u l l Y e a r ( )   = =   d r a w Y e a r ) ; 
 	 	 	 m o n t h H t m l   + =   ' < s e l e c t   c l a s s = " u i - d a t e p i c k e r - m o n t h "   '   + 
 	 	 	 	 ' o n c h a n g e = " D P _ j Q u e r y . d a t e p i c k e r . _ s e l e c t M o n t h Y e a r ( \ ' # '   +   i n s t . i d   +   ' \ ' ,   t h i s ,   \ ' M \ ' ) ; "   '   + 
 	 	 	 	 ' o n c l i c k = " D P _ j Q u e r y . d a t e p i c k e r . _ c l i c k M o n t h Y e a r ( \ ' # '   +   i n s t . i d   +   ' \ ' ) ; " '   + 
 	 	 	   	 ' > ' ; 
 	 	 	 f o r   ( v a r   m o n t h   =   0 ;   m o n t h   <   1 2 ;   m o n t h + + )   { 
 	 	 	 	 i f   ( ( ! i n M i n Y e a r   | |   m o n t h   > =   m i n D a t e . g e t M o n t h ( ) )   & & 
 	 	 	 	 	 	 ( ! i n M a x Y e a r   | |   m o n t h   < =   m a x D a t e . g e t M o n t h ( ) ) ) 
 	 	 	 	 	 m o n t h H t m l   + =   ' < o p t i o n   v a l u e = " '   +   m o n t h   +   ' " '   + 
 	 	 	 	 	 	 ( m o n t h   = =   d r a w M o n t h   ?   '   s e l e c t e d = " s e l e c t e d " '   :   ' ' )   + 
 	 	 	 	 	 	 ' > '   +   m o n t h N a m e s S h o r t [ m o n t h ]   +   ' < / o p t i o n > ' ; 
 	 	 	 } 
 	 	 	 m o n t h H t m l   + =   ' < / s e l e c t > ' ; 
 	 	 } 
 	 	 i f   ( ! s h o w M o n t h A f t e r Y e a r ) 
 	 	 	 h t m l   + =   m o n t h H t m l   +   ( ( s e c o n d a r y   | |   c h a n g e M o n t h   | |   c h a n g e Y e a r )   & &   ( ! ( c h a n g e M o n t h   & &   c h a n g e Y e a r ) )   ?   ' & # x a 0 ; '   :   ' ' ) ; 
 	 	 / /   y e a r   s e l e c t i o n 
 	 	 i f   ( s e c o n d a r y   | |   ! c h a n g e Y e a r ) 
 	 	 	 h t m l   + =   ' < s p a n   c l a s s = " u i - d a t e p i c k e r - y e a r " > '   +   d r a w Y e a r   +   ' < / s p a n > ' ; 
 	 	 e l s e   { 
 	 	 	 / /   d e t e r m i n e   r a n g e   o f   y e a r s   t o   d i s p l a y 
 	 	 	 v a r   y e a r s   =   t h i s . _ g e t ( i n s t ,   ' y e a r R a n g e ' ) . s p l i t ( ' : ' ) ; 
 	 	 	 v a r   y e a r   =   0 ; 
 	 	 	 v a r   e n d Y e a r   =   0 ; 
 	 	 	 i f   ( y e a r s . l e n g t h   ! =   2 )   { 
 	 	 	 	 y e a r   =   d r a w Y e a r   -   1 0 ; 
 	 	 	 	 e n d Y e a r   =   d r a w Y e a r   +   1 0 ; 
 	 	 	 }   e l s e   i f   ( y e a r s [ 0 ] . c h a r A t ( 0 )   = =   ' + '   | |   y e a r s [ 0 ] . c h a r A t ( 0 )   = =   ' - ' )   { 
 	 	 	 	 y e a r   =   d r a w Y e a r   +   p a r s e I n t ( y e a r s [ 0 ] ,   1 0 ) ; 
 	 	 	 	 e n d Y e a r   =   d r a w Y e a r   +   p a r s e I n t ( y e a r s [ 1 ] ,   1 0 ) ; 
 	 	 	 }   e l s e   { 
 	 	 	 	 y e a r   =   p a r s e I n t ( y e a r s [ 0 ] ,   1 0 ) ; 
 	 	 	 	 e n d Y e a r   =   p a r s e I n t ( y e a r s [ 1 ] ,   1 0 ) ; 
 	 	 	 } 
 	 	 	 y e a r   =   ( m i n D a t e   ?   M a t h . m a x ( y e a r ,   m i n D a t e . g e t F u l l Y e a r ( ) )   :   y e a r ) ; 
 	 	 	 e n d Y e a r   =   ( m a x D a t e   ?   M a t h . m i n ( e n d Y e a r ,   m a x D a t e . g e t F u l l Y e a r ( ) )   :   e n d Y e a r ) ; 
 	 	 	 h t m l   + =   ' < s e l e c t   c l a s s = " u i - d a t e p i c k e r - y e a r "   '   + 
 	 	 	 	 ' o n c h a n g e = " D P _ j Q u e r y . d a t e p i c k e r . _ s e l e c t M o n t h Y e a r ( \ ' # '   +   i n s t . i d   +   ' \ ' ,   t h i s ,   \ ' Y \ ' ) ; "   '   + 
 	 	 	 	 ' o n c l i c k = " D P _ j Q u e r y . d a t e p i c k e r . _ c l i c k M o n t h Y e a r ( \ ' # '   +   i n s t . i d   +   ' \ ' ) ; " '   + 
 	 	 	 	 ' > ' ; 
 	 	 	 f o r   ( ;   y e a r   < =   e n d Y e a r ;   y e a r + + )   { 
 	 	 	 	 h t m l   + =   ' < o p t i o n   v a l u e = " '   +   y e a r   +   ' " '   + 
 	 	 	 	 	 ( y e a r   = =   d r a w Y e a r   ?   '   s e l e c t e d = " s e l e c t e d " '   :   ' ' )   + 
 	 	 	 	 	 ' > '   +   y e a r   +   ' < / o p t i o n > ' ; 
 	 	 	 } 
 	 	 	 h t m l   + =   ' < / s e l e c t > ' ; 
 	 	 } 
 	 	 i f   ( s h o w M o n t h A f t e r Y e a r ) 
 	 	 	 h t m l   + =   ( s e c o n d a r y   | |   c h a n g e M o n t h   | |   c h a n g e Y e a r   ?   ' & # x a 0 ; '   :   ' ' )   +   m o n t h H t m l ; 
 	 	 h t m l   + =   ' < / d i v > ' ;   / /   C l o s e   d a t e p i c k e r _ h e a d e r 
 	 	 r e t u r n   h t m l ; 
 	 } , 
 
 	 / *   A d j u s t   o n e   o f   t h e   d a t e   s u b - f i e l d s .   * / 
 	 _ a d j u s t I n s t D a t e :   f u n c t i o n ( i n s t ,   o f f s e t ,   p e r i o d )   { 
 	 	 v a r   y e a r   =   i n s t . d r a w Y e a r   +   ( p e r i o d   = =   ' Y '   ?   o f f s e t   :   0 ) ; 
 	 	 v a r   m o n t h   =   i n s t . d r a w M o n t h   +   ( p e r i o d   = =   ' M '   ?   o f f s e t   :   0 ) ; 
 	 	 v a r   d a y   =   M a t h . m i n ( i n s t . s e l e c t e d D a y ,   t h i s . _ g e t D a y s I n M o n t h ( y e a r ,   m o n t h ) )   + 
 	 	 	 ( p e r i o d   = =   ' D '   ?   o f f s e t   :   0 ) ; 
 	 	 v a r   d a t e   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( y e a r ,   m o n t h ,   d a y ) ) ; 
 	 	 / /   e n s u r e   i t   i s   w i t h i n   t h e   b o u n d s   s e t 
 	 	 v a r   m i n D a t e   =   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m i n ' ,   t r u e ) ; 
 	 	 v a r   m a x D a t e   =   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m a x ' ) ; 
 	 	 d a t e   =   ( m i n D a t e   & &   d a t e   <   m i n D a t e   ?   m i n D a t e   :   d a t e ) ; 
 	 	 d a t e   =   ( m a x D a t e   & &   d a t e   >   m a x D a t e   ?   m a x D a t e   :   d a t e ) ; 
 	 	 i n s t . s e l e c t e d D a y   =   d a t e . g e t D a t e ( ) ; 
 	 	 i n s t . d r a w M o n t h   =   i n s t . s e l e c t e d M o n t h   =   d a t e . g e t M o n t h ( ) ; 
 	 	 i n s t . d r a w Y e a r   =   i n s t . s e l e c t e d Y e a r   =   d a t e . g e t F u l l Y e a r ( ) ; 
 	 	 i f   ( p e r i o d   = =   ' M '   | |   p e r i o d   = =   ' Y ' ) 
 	 	 	 t h i s . _ n o t i f y C h a n g e ( i n s t ) ; 
 	 } , 
 
 	 / *   N o t i f y   c h a n g e   o f   m o n t h / y e a r .   * / 
 	 _ n o t i f y C h a n g e :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   o n C h a n g e   =   t h i s . _ g e t ( i n s t ,   ' o n C h a n g e M o n t h Y e a r ' ) ; 
 	 	 i f   ( o n C h a n g e ) 
 	 	 	 o n C h a n g e . a p p l y ( ( i n s t . i n p u t   ?   i n s t . i n p u t [ 0 ]   :   n u l l ) , 
 	 	 	 	 [ i n s t . s e l e c t e d Y e a r ,   i n s t . s e l e c t e d M o n t h   +   1 ,   i n s t ] ) ; 
 	 } , 
 
 	 / *   D e t e r m i n e   t h e   n u m b e r   o f   m o n t h s   t o   s h o w .   * / 
 	 _ g e t N u m b e r O f M o n t h s :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   n u m M o n t h s   =   t h i s . _ g e t ( i n s t ,   ' n u m b e r O f M o n t h s ' ) ; 
 	 	 r e t u r n   ( n u m M o n t h s   = =   n u l l   ?   [ 1 ,   1 ]   :   ( t y p e o f   n u m M o n t h s   = =   ' n u m b e r '   ?   [ 1 ,   n u m M o n t h s ]   :   n u m M o n t h s ) ) ; 
 	 } , 
 
 	 / *   D e t e r m i n e   t h e   c u r r e n t   m a x i m u m   d a t e   -   e n s u r e   n o   t i m e   c o m p o n e n t s   a r e   s e t   -   m a y   b e   o v e r r i d d e n   f o r   a   r a n g e .   * / 
 	 _ g e t M i n M a x D a t e :   f u n c t i o n ( i n s t ,   m i n M a x ,   c h e c k R a n g e )   { 
 	 	 v a r   d a t e   =   t h i s . _ d e t e r m i n e D a t e ( t h i s . _ g e t ( i n s t ,   m i n M a x   +   ' D a t e ' ) ,   n u l l ) ; 
 	 	 r e t u r n   ( ! c h e c k R a n g e   | |   ! i n s t . r a n g e S t a r t   ?   d a t e   : 
 	 	 	 ( ! d a t e   | |   i n s t . r a n g e S t a r t   >   d a t e   ?   i n s t . r a n g e S t a r t   :   d a t e ) ) ; 
 	 } , 
 
 	 / *   F i n d   t h e   n u m b e r   o f   d a y s   i n   a   g i v e n   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 ( ) ; 
 	 } , 
 
 	 / *   F i n d   t h e   d a y   o f   t h e   w e e k   o f   t h e   f i r s t   o f   a   m o n t h .   * / 
 	 _ g e t F i r s t D a y O f 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   n e w   D a t e ( y e a r ,   m o n t h ,   1 ) . g e t D a y ( ) ; 
 	 } , 
 
 	 / *   D e t e r m i n e s   i f   w e   s h o u l d   a l l o w   a   " n e x t / p r e v "   m o n t h   d i s p l a y   c h a n g e .   * / 
 	 _ c a n A d j u s t M o n t h :   f u n c t i o n ( i n s t ,   o f f s e t ,   c u r Y e a r ,   c u r M o n t h )   { 
 	 	 v a r   n u m M o n t h s   =   t h i s . _ g e t N u m b e r O f M o n t h s ( i n s t ) ; 
 	 	 v a r   d a t e   =   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( 
 	 	 	 c u r Y e a r ,   c u r M o n t h   +   ( o f f s e t   <   0   ?   o f f s e t   :   n u m M o n t h s [ 1 ] ) ,   1 ) ) ; 
 	 	 i f   ( o f f s e t   <   0 ) 
 	 	 	 d a t e . s e t D a t e ( t h i s . _ 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 ( ) ,   d a t e . g e t M o n t h ( ) ) ) ; 
 	 	 r e t u r n   t h i s . _ i s I n R a n g e ( i n s t ,   d a t e ) ; 
 	 } , 
 
 	 / *   I s   t h e   g i v e n   d a t e   i n   t h e   a c c e p t e d   r a n g e ?   * / 
 	 _ i s I n R a n g e :   f u n c t i o n ( i n s t ,   d a t e )   { 
 	 	 / /   d u r i n g   r a n g e   s e l e c t i o n ,   u s e   m i n i m u m   o f   s e l e c t e d   d a t e   a n d   r a n g e   s t a r t 
 	 	 v a r   n e w M i n D a t e   =   ( ! i n s t . r a n g e S t a r t   ?   n u l l   :   t h i s . _ d a y l i g h t S a v i n g A d j u s t ( 
 	 	 	 n e w   D a t e ( i n s t . s e l e c t e d Y e a r ,   i n s t . s e l e c t e d M o n t h ,   i n s t . s e l e c t e d D a y ) ) ) ; 
 	 	 n e w M i n D a t e   =   ( n e w M i n D a t e   & &   i n s t . r a n g e S t a r t   <   n e w M i n D a t e   ?   i n s t . r a n g e S t a r t   :   n e w M i n D a t e ) ; 
 	 	 v a r   m i n D a t e   =   n e w M i n D a t e   | |   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m i n ' ) ; 
 	 	 v a r   m a x D a t e   =   t h i s . _ g e t M i n M a x D a t e ( i n s t ,   ' m a x ' ) ; 
 	 	 r e t u r n   ( ( ! m i n D a t e   | |   d a t e   > =   m i n D a t e )   & &   ( ! m a x D a t e   | |   d a t e   < =   m a x D a t e ) ) ; 
 	 } , 
 
 	 / *   P r o v i d e   t h e   c o n f i g u r a t i o n   s e t t i n g s   f o r   f o r m a t t i n g / p a r s i n g .   * / 
 	 _ g e t F o r m a t C o n f i g :   f u n c t i o n ( i n s t )   { 
 	 	 v a r   s h o r t Y e a r C u t o f f   =   t h i s . _ g e t ( i n s t ,   ' s h o r t Y e a r C u t o f f ' ) ; 
 	 	 s h o r t Y e a r C u t o f f   =   ( t y p e o f   s h o r t Y e a r C u t o f f   ! =   ' s t r i n g '   ?   s h o r t Y e a r C u t o f f   : 
 	 	 	 n e w   D a t e ( ) . g e t F u l l Y e a r ( )   %   1 0 0   +   p a r s e I n t ( s h o r t Y e a r C u t o f f ,   1 0 ) ) ; 
 	 	 r e t u r n   { s h o r t Y e a r C u t o f f :   s h o r t Y e a r C u t o f f , 
 	 	 	 d a y N a m e s S h o r t :   t h i s . _ g e t ( i n s t ,   ' d a y N a m e s S h o r t ' ) ,   d a y N a m e s :   t h i s . _ g e t ( i n s t ,   ' d a y N a m e s ' ) , 
 	 	 	 m o n t h N a m e s S h o r t :   t h i s . _ g e t ( i n s t ,   ' m o n t h N a m e s S h o r t ' ) ,   m o n t h N a m e s :   t h i s . _ g e t ( i n s t ,   ' m o n t h N a m e s ' ) } ; 
 	 } , 
 
 	 / *   F o r m a t   t h e   g i v e n   d a t e   f o r   d i s p l a y .   * / 
 	 _ f o r m a t D a t e :   f u n c t i o n ( i n s t ,   d a y ,   m o n t h ,   y e a r )   { 
 	 	 i f   ( ! d a y )   { 
 	 	 	 i n s t . c u r r e n t D a y   =   i n s t . s e l e c t e d D a y ; 
 	 	 	 i n s t . c u r r e n t M o n t h   =   i n s t . s e l e c t e d M o n t h ; 
 	 	 	 i n s t . c u r r e n t Y e a r   =   i n s t . s e l e c t e d Y e a r ; 
 	 	 } 
 	 	 v a r   d a t e   =   ( d a y   ?   ( t y p e o f   d a y   = =   ' o b j e c t '   ?   d a y   : 
 	 	 	 t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( y e a r ,   m o n t h ,   d a y ) ) )   : 
 	 	 	 t h i s . _ d a y l i g h t S a v i n g A d j u s t ( n e w   D a t e ( i n s t . c u r r e n t Y e a r ,   i n s t . c u r r e n t M o n t h ,   i n s t . c u r r e n t D a y ) ) ) ; 
 	 	 r e t u r n   t h i s . f o r m a t D a t e ( t h i s . _ g e t ( i n s t ,   ' d a t e F o r m a t ' ) ,   d a t e ,   t h i s . _ g e t F o r m a t C o n f i g ( i n s t ) ) ; 
 	 } 
 } ) ; 
 
 / *   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 !   * / 
 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   | |   p r o p s [ n a m e ]   = =   u n d e f i n e d ) 
 	 	 	 t a r g e t [ n a m e ]   =   p r o p s [ n a m e ] ; 
 	 r e t u r n   t a r g e t ; 
 } ; 
 
 / *   D e t e r m i n e   w h e t h e r   a n   o b j e c t   i s   a n   a r r a y .   * / 
 f u n c t i o n   i s A r r a y ( a )   { 
 	 r e t u r n   ( a   & &   ( ( $ . b r o w s e r . s a f a r i   & &   t y p e o f   a   = =   ' o b j e c t '   & &   a . l e n g t h )   | | 
 	 	 ( a . c o n s t r u c t o r   & &   a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / \ A r r a y \ ( \ ) / ) ) ) ) ; 
 } ; 
 
 / *   I n v o k e   t h e   d a t e p i c k e r   f u n c t i o n a l i t y . 
       @ p a r a m     o p t i o n s     s t r i n g   -   a   c o m m a n d ,   o p t i o n a l l y   f o l l o w e d   b y   a d d i t i o n a l   p a r a m e t e r s   o r 
                                         O b j e c t   -   s e t t i n g s   f o r   a t t a c h i n g   n e w   d a t e p i c k e r   f u n c t i o n a l i t y 
       @ r e t u r n     j Q u e r y   o b j e c t   * / 
 $ . f n . d a t e p i c k e r   =   f u n c t i o n ( o p t i o n s ) { 
 
 	 / *   I n i t i a l i s e   t h e   d a t e   p i c k e r .   * / 
 	 i f   ( ! $ . d a t e p i c k e r . i n i t i a l i z e d )   { 
 	 	 $ ( d o c u m e n t ) . m o u s e d o w n ( $ . d a t e p i c k e r . _ c h e c k E x t e r n a l C l i c k ) . 
 	 	 	 f i n d ( ' b o d y ' ) . a p p e n d ( $ . d a t e p i c k e r . d p D i v ) ; 
 	 	 $ . d a t e p i c k e r . i n i t i a l i z e d   =   t r u e ; 
 	 } 
 
 	 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   ( t y p e o f   o p t i o n s   = =   ' s t r i n g '   & &   ( o p t i o n s   = =   ' i s D i s a b l e d '   | |   o p t i o n s   = =   ' g e t D a t e ' ) ) 
 	 	 r e t u r n   $ . d a t e p i c k e r [ ' _ '   +   o p t i o n s   +   ' D a t e p i c k e r ' ] . 
 	 	 	 a p p l y ( $ . d a t e p i c k e r ,   [ 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 ( )   { 
 	 	 t y p e o f   o p t i o n s   = =   ' s t r i n g '   ? 
 	 	 	 $ . d a t e p i c k e r [ ' _ '   +   o p t i o n s   +   ' D a t e p i c k e r ' ] . 
 	 	 	 	 a p p l y ( $ . d a t e p i c k e r ,   [ t h i s ] . c o n c a t ( o t h e r A r g s ) )   : 
 	 	 	 $ . d a t e p i c k e r . _ a t t a c h D a t e p i c k e r ( t h i s ,   o p t i o n s ) ; 
 	 } ) ; 
 } ; 
 
 $ . d a t e p i c k e r   =   n e w   D a t e p i c k e r ( ) ;   / /   s i n g l e t o n   i n s t a n c e 
 $ . d a t e p i c k e r . i n i t i a l i z e d   =   f a l s e ; 
 $ . d a t e p i c k e r . u u i d   =   n e w   D a t e ( ) . g e t T i m e ( ) ; 
 $ . d a t e p i c k e r . v e r s i o n   =   " @ V E R S I O N " ; 
 
 / /   W o r k a r o u n d   f o r   # 4 0 5 5 
 / /   A d d   a n o t h e r   g l o b a l   t o   a v o i d   n o C o n f l i c t   i s s u e s   w i t h   i n l i n e   e v e n t   h a n d l e r s 
 w i n d o w . D P _ j Q u e r y   =   $ ;  
  
 } ) ( j Q u e r y ) ;  
  
    
 / *   u i . d a t e p i c k e r - i t . j s     * /  
 / *   I t a l i a n   i n i t i a l i s a t i o n   f o r   t h e   j Q u e r y   U I   d a t e   p i c k e r   p l u g i n .   * /  
 / *   W r i t t e n   b y   A p a e l l a   ( a p a e l l a @ g m a i l . c o m ) .   * /  
 j Q u e r y ( f u n c t i o n ( $ )   {  
         $ . d a t e p i c k e r . r e g i o n a l [ ' i t ' ]   =   {  
                 c l o s e T e x t :   ' C h i u d i ' ,  
                 p r e v T e x t :   ' & # x 3 c ; P r e c ' ,  
                 n e x t T e x t :   ' S u c c & # x 3 e ; ' ,  
                 c u r r e n t T e x t :   ' O g g i ' ,  
                 m o n t h N a m e s :   [ ' G e n n a i o ' ,   ' F e b b r a i o ' ,   ' M a r z o ' ,   ' A p r i l e ' ,   ' M a g g i o ' ,   ' G i u g n o ' ,  
 	 	 ' L u g l i o ' ,   ' A g o s t o ' ,   ' S e t t e m b r e ' ,   ' O t t o b r e ' ,   ' N o v e m b r e ' ,   ' D i c e m b r e ' ] ,  
                 m o n t h N a m e s S h o r t :   [ ' G e n ' ,   ' F e b ' ,   ' M a r ' ,   ' A p r ' ,   ' M a g ' ,   ' G i u ' ,  
 	 	 ' L u g ' ,   ' A g o ' ,   ' S e t ' ,   ' O t t ' ,   ' N o v ' ,   ' D i c ' ] ,  
                 d a y N a m e s :   [ ' D o m e n i c a ' ,   ' L u n e d & # 2 3 6 ' ,   ' M a r t e d & # 2 3 6 ' ,   ' M e r c o l e d & # 2 3 6 ' ,   ' G i o v e d & # 2 3 6 ' ,   ' V e n e r d & # 2 3 6 ' ,   ' S a b a t o ' ] ,  
                 d a y N a m e s S h o r t :   [ ' D o m ' ,   ' L u n ' ,   ' M a r ' ,   ' M e r ' ,   ' G i o ' ,   ' V e n ' ,   ' S a b ' ] ,  
                 d a y N a m e s M i n :   [ ' D o ' ,   ' L u ' ,   ' M a ' ,   ' M e ' ,   ' G i o ' ,   ' V e ' ,   ' S a ' ] ,  
                 d a t e F o r m a t :   ' d d / m m / y y ' ,   f i r s t D a y :   1 ,  
                 i s R T L :   f a l s e  
         } ;  
         $ . d a t e p i c k e r . s e t D e f a u l t s ( $ . d a t e p i c k e r . r e g i o n a l [ ' i t ' ] ) ;  
 } ) ;  
 / *   u i . d a t e p i c k e r - i t . j s   e n d   * /  
  
  
 / *   u i . d a t e p i c k e r - f r . j s   * /  
 / *   F r e n c h   i n i t i a l i s a t i o n   f o r   t h e   j Q u e r y   U I   d a t e   p i c k e r   p l u g i n .   * /  
 / *   W r i t t e n   b y   K e i t h   W o o d   ( k b w o o d @ v i r g i n b r o a d b a n d . c o m . a u )   a n d   S t é p h a n e   N a h m a n i   ( s h o l b y @ s h o l b y . n e t ) .   * /  
 j Q u e r y ( f u n c t i o n ( $ )   {  
         $ . d a t e p i c k e r . r e g i o n a l [ ' f r ' ]   =   {  
                 c l o s e T e x t :   ' F e r m e r ' ,  
                 p r e v T e x t :   ' & # x 3 c ; P r é c ' ,  
                 n e x t T e x t :   ' S u i v & # x 3 e ; ' ,  
                 c u r r e n t T e x t :   ' C o u r a n t ' ,  
                 m o n t h N a m e s :   [ ' J a n v i e r ' ,   ' F é v r i e r ' ,   ' M a r s ' ,   ' A v r i l ' ,   ' M a i ' ,   ' J u i n ' ,  
 	 	 ' J u i l l e t ' ,   ' A o û t ' ,   ' S e p t e m b r e ' ,   ' O c t o b r e ' ,   ' N o v e m b r e ' ,   ' D é c e m b r e ' ] ,  
                 m o n t h N a m e s S h o r t :   [ ' J a n ' ,   ' F é v ' ,   ' M a r ' ,   ' A v r ' ,   ' M a i ' ,   ' J u n ' ,  
 	 	 ' J u l ' ,   ' A o û ' ,   ' S e p ' ,   ' O c t ' ,   ' N o v ' ,   ' D é c ' ] ,  
                 d a y N a m e s :   [ ' D i m a n c h e ' ,   ' L u n d i ' ,   ' M a r d i ' ,   ' M e r c r e d i ' ,   ' J e u d i ' ,   ' V e n d r e d i ' ,   ' S a m e d i ' ] ,  
                 d a y N a m e s S h o r t :   [ ' D i m ' ,   ' L u n ' ,   ' M a r ' ,   ' M e r ' ,   ' J e u ' ,   ' V e n ' ,   ' S a m ' ] ,  
                 d a y N a m e s M i n :   [ ' D i ' ,   ' L u ' ,   ' M a ' ,   ' M e ' ,   ' J e ' ,   ' V e ' ,   ' S a ' ] ,  
                 d a t e F o r m a t :   ' d d / m m / y y ' ,   f i r s t D a y :   1 ,  
                 i s R T L :   f a l s e  
         } ;  
         $ . d a t e p i c k e r . s e t D e f a u l t s ( $ . d a t e p i c k e r . r e g i o n a l [ ' f r ' ] ) ;  
 } ) ;  
  
  
 / *   u i . d a t e p i c k e r - f r . j s   e n d   * /  
  
  
 / *   u i . d a t e p i c k e r - e s . j s   * /  
 / *   I n i c i a l i z a c i ýÿn   e n   e s p a ýÿo l   p a r a   l a   e x t e n s i ýÿn   ' U I   d a t e   p i c k e r '   p a r a   j Q u e r y .   * /  
 / *   T r a d u c i d o   p o r   V e s t e r   ( x v e s t e r @ g m a i l . c o m ) .   * /  
 j Q u e r y ( f u n c t i o n ( $ )   {  
         $ . d a t e p i c k e r . r e g i o n a l [ ' e s ' ]   =   {  
                 c l o s e T e x t :   ' C e r r a r ' ,  
                 p r e v T e x t :   ' & # x 3 c ; A n t ' ,  
                 n e x t T e x t :   ' S i g & # x 3 e ; ' ,  
                 c u r r e n t T e x t :   ' H o y ' ,  
                 m o n t h N a m e s :   [ ' E n e r o ' ,   ' F e b r e r o ' ,   ' M a r z o ' ,   ' A b r i l ' ,   ' M a y o ' ,   ' J u n i o ' ,  
 	 	 ' J u l i o ' ,   ' A g o s t o ' ,   ' S e p t i e m b r e ' ,   ' O c t u b r e ' ,   ' N o v i e m b r e ' ,   ' D i c i e m b r e ' ] ,  
                 m o n t h N a m e s S h o r t :   [ ' E n e ' ,   ' F e b ' ,   ' M a r ' ,   ' A b r ' ,   ' M a y ' ,   ' J u n ' ,  
 	 	 ' J u l ' ,   ' A g o ' ,   ' S e p ' ,   ' O c t ' ,   ' N o v ' ,   ' D i c ' ] ,  
                 d a y N a m e s :   [ ' D o m i n g o ' ,   ' L u n e s ' ,   ' M a r t e s ' ,   ' M i & e a c u t e ; r c o l e s ' ,   ' J u e v e s ' ,   ' V i e r n e s ' ,   ' S & a a c u t e ; b a d o ' ] ,  
                 d a y N a m e s S h o r t :   [ ' D o m ' ,   ' L u n ' ,   ' M a r ' ,   ' M i & e a c u t e ; ' ,   ' J u v ' ,   ' V i e ' ,   ' S & a a c u t e ; b ' ] ,  
                 d a y N a m e s M i n :   [ ' D o ' ,   ' L u ' ,   ' M a ' ,   ' M i ' ,   ' J u ' ,   ' V i ' ,   ' S & a a c u t e ; ' ] ,  
                 d a t e F o r m a t :   ' d d / m m / y y ' ,   f i r s t D a y :   0 ,  
                 i s R T L :   f a l s e  
         } ;  
         $ . d a t e p i c k e r . s e t D e f a u l t s ( $ . d a t e p i c k e r . r e g i o n a l [ ' e s ' ] ) ;  
 } ) ;  
  
  
 / *   u i . d a t e p i c k e r - e s . j s   e n d   * /  
  
  
  
 / *   u i . d a t e p i c k e r - d e . j s   * /  
 / *   G e r m a n   i n i t i a l i s a t i o n   f o r   t h e   j Q u e r y   U I   d a t e   p i c k e r   p l u g i n .   * /  
 / *   W r i t t e n   b y   M i l i a n   W o l f f   ( m a i l @ m i l i a n w . d e ) .   * /  
 j Q u e r y ( f u n c t i o n ( $ )   {  
         $ . d a t e p i c k e r . r e g i o n a l [ ' d e ' ]   =   {  
                 c l o s e T e x t :   ' s c h l i e ß e n ' ,  
                 p r e v T e x t :   ' & # x 3 c ; z u r ü c k ' ,  
                 n e x t T e x t :   ' V o r & # x 3 e ; ' ,  
                 c u r r e n t T e x t :   ' h e u t e ' ,  
                 m o n t h N a m e s :   [ ' J a n u a r ' ,   ' F e b r u a r ' ,   ' M ä r z ' ,   ' A p r i l ' ,   ' M a i ' ,   ' J u n i ' ,  
 	 	 ' J u l i ' ,   ' A u g u s t ' ,   ' S e p t e m b e r ' ,   ' O k t o b e r ' ,   ' N o v e m b e r ' ,   ' D e z e m b e r ' ] ,  
                 m o n t h N a m e s S h o r t :   [ ' J a n ' ,   ' F e b ' ,   ' M ä r ' ,   ' A p r ' ,   ' M a i ' ,   ' J u n ' ,  
 	 	 ' J u l ' ,   ' A u g ' ,   ' S e p ' ,   ' O k t ' ,   ' N o v ' ,   ' D e z ' ] ,  
                 d a y N a m e s :   [ ' S o n n t a g ' ,   ' M o n t a g ' ,   ' D i e n s t a g ' ,   ' M i t t w o c h ' ,   ' D o n n e r s t a g ' ,   ' F r e i t a g ' ,   ' S a m s t a g ' ] ,  
                 d a y N a m e s S h o r t :   [ ' S o ' ,   ' M o ' ,   ' D i ' ,   ' M i ' ,   ' D o ' ,   ' F r ' ,   ' S a ' ] ,  
                 d a y N a m e s M i n :   [ ' S o ' ,   ' M o ' ,   ' D i ' ,   ' M i ' ,   ' D o ' ,   ' F r ' ,   ' S a ' ] ,  
                 d a t e F o r m a t :   ' d d . m m . y y ' ,   f i r s t D a y :   1 ,  
                 i s R T L :   f a l s e  
         } ;  
         $ . d a t e p i c k e r . s e t D e f a u l t s ( $ . d a t e p i c k e r . r e g i o n a l [ ' d e ' ] ) ;  
 } ) ; 
 
 
 / *   u i . d a t e p i c k e r - d e . u s   e n d   * / 
 
 
 
 
 
