ÿþ( f u n c t i o n   ( j Q u e r y )   {  
 	 j Q u e r y . e x t e n d ( 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 :   " 1 . 7 . 2 "  
 	 	 }  
 	 } ) ;  
 	 v a r   P R O P _ N A M E   =   ' d a t e p i c k e r ' ;  
 	 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 ;  
 	 	 t h i s . _ c u r I n s t   =   n u l l ;  
 	 	 t h i s . _ k e y E v e n t   =   f a l s e ;  
 	 	 t h i s . _ d i s a b l e d I n p u t s   =   [ ] ;  
 	 	 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 . _ i n D i a l o g   =   f a l s e ;  
 	 	 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 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 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 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 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 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 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 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 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 i s . r e g i o n a l   =   [ ] ;  
 	 	 t h i s . r e g i o n a l [ ' ' ]   =   {  
 	 	 	 c l o s e T e x t :   ' D o n e ' ,  
 	 	 	 p r e v T e x t :   ' P r e v ' ,  
 	 	 	 n e x t T e x t :   ' N e x t ' ,  
 	 	 	 c u r r e n t T e x t :   ' T o d a y ' ,  
 	 	 	 m o n t h N a m e s :   [ ' J a n u á r ' ,   ' F e b r u á r ' ,   ' M á r c i u s ' ,   ' Á p r i l i s ' ,   ' M á j u s ' ,   ' J ú n i u s ' ,   ' J ú l i u s ' ,   ' A u g u s z t u s ' ,   ' S z e p t e m b e r ' ,   ' O k t ó b e r ' ,   ' N o v e m b e r ' ,   ' D e c 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 ' ,   ' Á p r ' ,   ' M á j ' ,   ' J ú n ' ,   ' J ú l ' ,   ' A u g ' ,   ' S e p ' ,   ' O k t ' ,   ' N o v ' ,   ' D e c ' ] ,  
 	 	 	 d a y N a m e s :   [ ' V a s á r n a p ' ,   ' H é t f Q' ,   ' K e d d ' ,   ' S z e r d a ' ,   ' C s ü t ö r t ö k ' ,   ' P é n t e k ' ,   ' S z o m b a t ' ] ,  
 	 	 	 d a y N a m e s S h o r t :   [ ' V a s ' ,   ' H é t f ' ,   ' K e d d ' ,   ' S z e r d ' ,   ' C s ü t ' ,   ' P é n t ' ,   ' S z o m b ' ] ,  
 	 	 	 d a y N a m e s M i n :   [ ' V ' ,   ' H ' ,   ' K ' ,   ' S z ' ,   ' C s ' ,   ' P ' ,   ' S z ' ] ,  
 	 	 	 d a t e F o r m a t :   ' y y / m m / d d ' ,  
 	 	 	 f i r s t D a y :   1 ,  
 	 	 	 i s R T L :   f a l s e  
 	 	 } ;  
 	 	 t h i s . _ d e f a u l t s   =   {  
 	 	 	 s h o w O n :   ' f o c u s ' ,  
 	 	 	 s h o w A n i m :   ' s h o w ' ,  
 	 	 	 s h o w O p t i o n s :   { } ,  
 	 	 	 d e f a u l t D a t e :   n u l l ,  
 	 	 	 a p p e n d T e x t :   ' ' ,  
 	 	 	 b u t t o n T e x t :   ' . . . ' ,  
 	 	 	 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 ,  
 	 	 	 h i d e I f N o P r e v N e x t :   f a l s e ,  
 	 	 	 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 ,  
 	 	 	 g o t o C u r r e n t :   f a l s e ,  
 	 	 	 c h a n g e M o n t h :   f a l s e ,  
 	 	 	 c h a n g e Y e a r :   f a l s e ,  
 	 	 	 s h o w M o n t h A f t e r Y e a r :   f a l s e ,  
 	 	 	 y e a r R a n g e :   ' - 1 0 : + 1 0 ' ,  
 	 	 	 s h o w O t h e r M o n t h s :   f a l s e ,  
 	 	 	 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 ,  
 	 	 	 s h o r t Y e a r C u t o f f :   ' + 1 0 ' ,  
 	 	 	 m i n D a t e :   n u l l ,  
 	 	 	 m a x D a t e :   n u l l ,  
 	 	 	 d u r a t i o n :   ' n o r m a l ' ,  
 	 	 	 b e f o r e S h o w D a y :   n u l l ,  
 	 	 	 b e f o r e S h o w :   n u l l ,  
 	 	 	 o n S e l e c t :   n u l l ,  
 	 	 	 o n C h a n g e M o n t h Y e a r :   n u l l ,  
 	 	 	 o n C l o s e :   n u l l ,  
 	 	 	 n u m b e r O f M o n t h s :   1 ,  
 	 	 	 s h o w C u r r e n t A t P o s :   0 ,  
 	 	 	 s t e p M o n t h s :   1 ,  
 	 	 	 s t e p B i g M o n t h s :   1 2 ,  
 	 	 	 a l t F i e l d :   ' ' ,  
 	 	 	 a l t F o r m a t :   ' ' ,  
 	 	 	 c o n s t r a i n I n p u t :   t r u e ,  
 	 	 	 s h o w B u t t o n P a n e l :   f a l s e  
 	 	 } ;  
 	 	 j Q u e r y . 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   =   j Q u e r y ( ' < 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 > ' )  
 	 }  
 	 j Q u e r y . 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 ,   {  
 	 	 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 ' ,  
 	 	 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 )  
 	 	 } ,  
 	 	 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 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 )   {  
 	 	 	 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 ( j Q u e r y ( t a r g e t ) ,   i n l i n e ) ;  
 	 	 	 i n s t . s e t t i n g s   =   j Q u e r y . 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 )  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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 ' ) ;  
 	 	 	 r e t u r n   {  
 	 	 	 	 i d :   i d ,  
 	 	 	 	 i n p u t :   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 ,  
 	 	 	 	 d r a w M o n t h :   0 ,  
 	 	 	 	 d r a w Y e a r :   0 ,  
 	 	 	 	 i n l i n e :   i n l i n e ,  
 	 	 	 	 d p D i v :   ( ! i n l i n e   ?   t h i s . d p D i v :   j Q u e r y ( ' < 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 > ' ) )  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( t a r g e t ) ;  
 	 	 	 i n s t . a p p e n d   =   j Q u e r y ( [ ] ) ;  
 	 	 	 i n s t . t r i g g e r   =   j Q u e r y ( [ ] ) ;  
 	 	 	 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   =   j Q u e r y ( ' < 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 ' )   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 ' )   {  
 	 	 	 	 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   =   j Q u e r y ( 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 ' )   ?   j Q u e r 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  
 	 	 	 	 } )   :   j Q u e r y ( ' < 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 :   j Q u e r y ( ' < 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 ( j Q u e r y . 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   & &   j Q u e r y . 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 )   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 ( ) ;  
 	 	 	 	 	 e l s e   j Q u e r y . 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 )  
 	 	 	 } ) ;  
 	 	 	 j Q u e r y . d a t a ( t a r g e t ,   P R O P _ N A M E ,   i n s t )  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( 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 )  
 	 	 	 } ) ;  
 	 	 	 j Q u e r 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 )  
 	 	 } ,  
 	 	 _ 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 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   =   j Q u e r y ( ' < 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 ) ;  
 	 	 	 	 j Q u e r y ( ' 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   =   { } ;  
 	 	 	 	 j Q u e r y . 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   =   [ ( 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 ]  
 	 	 	 }  
 	 	 	 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 ( j Q u e r y . b l o c k U I )   j Q u e r y . b l o c k U I ( t h i s . d p D i v ) ;  
 	 	 	 j Q u e r y . 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 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   =   j Q u e r y ( t a r g e t ) ;  
 	 	 	 v a r   i n s t   =   j Q u e r y . 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 ( ) ;  
 	 	 	 j Q u e r y . r e m o v e D a t a ( t a r g e t ,   P R O P _ N A M E ) ;  
 	 	 	 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 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   =   j Q u e r y ( t a r g e t ) ;  
 	 	 	 v a r   i n s t   =   j Q u e r y . 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   =   j Q u e r y . 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 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   =   j Q u e r y ( t a r g e t ) ;  
 	 	 	 v a r   i n s t   =   j Q u e r y . 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   =   j Q u e r y . 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 )  
 	 	 	 } ) ;  
 	 	 	 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 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  
 	 	 } ,  
 	 	 _ 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   j Q u e r y . 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 '  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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   i n s t   =   t h i s . _ g e t I n s t ( t a r g e t ) ;  
 	 	 	 i f ( a r g u m e n t s . l e n g t h   = =   2   & &   t y p e o f   n a m e   = =   ' s t r i n g ' )   {  
 	 	 	 	 r e t u r n   ( n a m e   = =   ' d e f a u l t s '   ?   j Q u e r y . e x t e n d ( { } ,  
 	 	 	 	 j Q u e r y . d a t e p i c k e r . _ d e f a u l t s )   :   ( i n s t   ?   ( n a m e   = =   ' a l l '   ?   j Q u e r y . e x t e n d ( { } ,  
 	 	 	 	 i n s t . s e t t i n g s )   :   t h i s . _ g e t ( i n s t ,   n a m e ) )   :   n u l l ) )  
 	 	 	 }  
 	 	 	 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  
 	 	 	 }  
 	 	 	 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 )  
 	 	 	 	 }  
 	 	 	 	 v a r   d a t e   =   t h i s . _ g e t D a t e D a t e p i c k e r ( t a r g e 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 . _ s e t D a t e D a t e p i c k e r ( t a r g e t ,   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 )  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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 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 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 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 )  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y . 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 ( j Q u e r y . 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 :  
 	 	 	 	 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 ( n u l l ,   ' ' ) ;  
 	 	 	 	 b r e a k ;  
 	 	 	 c a s e   1 3 :  
 	 	 	 	 v a r   s e l   =   j Q u e r y ( ' t d . '   +   j Q u e r y . d a t e p i c k e r . _ d a y O v e r C l a s s   +   ' ,   t d . '   +   j Q u e r y . 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 ] )   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 ( 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   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 ( n u l l ,   j Q u e r y . 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 ;  
 	 	 	 	 b r e a k ;  
 	 	 	 c a s e   2 7 :  
 	 	 	 	 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 ( n u l l ,   j Q u e r y . 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 ;  
 	 	 	 c a s e   3 3 :  
 	 	 	 	 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 ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ?   - j Q u e r 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 ' )   :   - j Q u e r y . 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 ;  
 	 	 	 c a s e   3 4 :  
 	 	 	 	 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 ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ?   + j Q u e r 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 ' )   :   + j Q u e r y . 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 ;  
 	 	 	 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 )   j Q u e r 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 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 )   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 ( 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 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 )   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 ( 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 ;  
 	 	 	 	 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 )   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 ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ?   - j Q u e r 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 ' )   :   - j Q u e r y . 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 ;  
 	 	 	 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 )   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 ( 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 ;  
 	 	 	 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 )   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 ( 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 ;  
 	 	 	 	 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 )   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 ( e v e n t . t a r g e t ,   ( e v e n t . c t r l K e y   ?   + j Q u e r 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 ' )   :   + j Q u e r y . 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 ;  
 	 	 	 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 )   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 ( 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 ;  
 	 	 	 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 )   j Q u e r y . 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 ( )  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y . 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 ( j Q u e r y . 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   =   j Q u e r y . d a t e p i c k e r . _ p o s s i b l e C h a r s ( j Q u e r y . 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 )  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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 ' )   i n p u t   =   j Q u e r y ( ' i n p u t ' ,   i n p u t . p a r e n t N o d e ) [ 0 ] ;  
 	 	 	 i f ( j Q u e r y . 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 )   | |   j Q u e r y . d a t e p i c k e r . _ l a s t I n p u t   = =   i n p u t )   r e t u r n ;  
 	 	 	 v a r   i n s t   =   j Q u e r y . 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   =   j Q u e r y . 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 ] )   :   { } ) ) ;  
 	 	 	 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 ( n u l l ,   ' ' ) ;  
 	 	 	 j Q u e r y . d a t e p i c k e r . _ l a s t I n p u t   =   i n p u t ;  
 	 	 	 j Q u e r y . 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 ( j Q u e r y . d a t e p i c k e r . _ i n D i a l o g )   i n p u t . v a l u e   =   ' ' ;  
 	 	 	 i f ( ! j Q u e r y . d a t e p i c k e r . _ p o s )   {  
 	 	 	 	 j Q u e r y . d a t e p i c k e r . _ p o s   =   j Q u e r y . d a t e p i c k e r . _ f i n d P o s ( i n p u t ) ;  
 	 	 	 	 j Q u e r y . 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  
 	 	 	 }  
 	 	 	 v a r   i s F i x e d   =   f a l s e ;  
 	 	 	 j Q u e r y ( 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   | =   j Q u e r y ( 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   & &   j Q u e r y . b r o w s e r . o p e r a )   {  
 	 	 	 	 j Q u e r y . 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 ;  
 	 	 	 	 j Q u e r y . 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 :   j Q u e r y . d a t e p i c k e r . _ p o s [ 0 ] ,  
 	 	 	 	 t o p :   j Q u e r y . d a t e p i c k e r . _ p o s [ 1 ]  
 	 	 	 } ;  
 	 	 	 j Q u e r y . 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 ;  
 	 	 	 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 '  
 	 	 	 } ) ;  
 	 	 	 j Q u e r y . 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 ) ;  
 	 	 	 o f f s e t   =   j Q u e r y . 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 :   ( j Q u e r y . d a t e p i c k e r . _ i n D i a l o g   & &   j Q u e r y . 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   =   j Q u e r y . 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   =   j Q u e r y . 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   ( )   {  
 	 	 	 	 	 j Q u e r y . 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 ( j Q u e r y . b r o w s e r . m s i e   & &   p a r s e I n t ( j Q u e r y . b r o w s e r . v e r s i o n ,   1 0 )   <   7 )   j Q u e r y ( ' 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 ( j Q u e r y . e f f e c t s   & &   j Q u e r y . 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 ,   j Q u e r y . 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 ( ) ;  
 	 	 	 	 j Q u e r y . d a t e p i c k e r . _ c u r I n s t   =   i n s 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   ( )   {  
 	 	 	 	 j Q u e r y ( 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 )   j Q u e r y ( 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 )   j Q u e r y ( 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 ] ) )   {  
 	 	 	 	 	 j Q u e r y ( 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 ' ) ;  
 	 	 	 	 	 j Q u e r y ( 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 )   j Q u e r y ( 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 )   j Q u e r y ( 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   = =   j Q u e r y . d a t e p i c k e r . _ c u r I n s t )   j Q u e r y ( i n s t . i n p u t [ 0 ] ) . f o c u s ( )  
 	 	 } ,  
 	 	 _ 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 )   +   j Q u e r y ( 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 )   +   j Q u e r y ( 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 )   ?   j Q u e r y ( 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 ) )   ?   j Q u e r y ( d o c u m e n t ) . s c r o l l T o p ( )   :   0 ;  
 	 	 	 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 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   =   j Q u e r y ( 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 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   ! =   j Q u e r y . 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   ( )   {  
 	 	 	 	 	 j Q u e r y . 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   ! =   ' '   & &   j Q u e r y . e f f e c t s   & &   j Q u e r y . 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 ,   j Q u e r y . 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 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 ( j Q u e r y . b l o c k U I )   {  
 	 	 	 	 	 	 j Q u e r y . u n b l o c k U I ( ) ;  
 	 	 	 	 	 	 j Q u e r y ( ' 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 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 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 ( ! j Q u e r y . 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   =   j Q u e r y ( 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 ( ' # '   +   j Q u e r y . 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 ( j Q u e r y . 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 ( j Q u e r y . d a t e p i c k e r . _ t r i g g e r C l a s s )   & &   j Q u e r y . 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   & &   ! ( j Q u e r y . d a t e p i c k e r . _ i n D i a l o g   & &   j Q u e r y . b l o c k U I ) )   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 ( n u l l ,   ' ' )  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( 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 ) ,   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 )  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( 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 )  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( 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 )  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( 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   & &   ! j Q u e r y . 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  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( i d ) ;  
 	 	 	 i f ( j Q u e r y ( 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   =   j Q u e r 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 )  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( 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 ,   ' ' )  
 	 	 } ,  
 	 	 _ 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   =   j Q u e r y ( 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 ] ) ;  
 	 	 	 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 ' ) ;  
 	 	 	 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 ( ) ;  
 	 	 	 	 t h i s . _ l a s t I n p u t   =   n u l l  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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 )   {  
 	 	 	 	 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 ) ) ;  
 	 	 	 	 j Q u e r y ( a l t F i e l d ) . e a c h ( f u n c t i o n   ( )   {  
 	 	 	 	 	 j Q u e r y ( t h i s ) . v a l ( d a t e S t r )  
 	 	 	 	 } )  
 	 	 	 }  
 	 	 } ,  
 	 	 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 ) ,   ' ' ]  
 	 	 } ,  
 	 	 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 ) ;  
 	 	 	 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 ;  
 	 	 	 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 ) ;  
 	 	 	 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 )   {  
 	 	 	 	 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 ) ;  
 	 	 	 	 r e t u r n   j Q u e r y . 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 ) )   {  
 	 	 	 	 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 )   {  
 	 	 	 	 	 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  
 	 	 } ,  
 	 	 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 ;  
 	 	 	 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  
 	 	 	 } ;  
 	 	 	 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  
 	 	 	 } ;  
 	 	 	 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  
 	 	 	 } ;  
 	 	 	 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 ' ;  
 	 	 	 r e t u r n   d a t e  
 	 	 } ,  
 	 	 A T O M :   ' y y - m m - d d ' ,  
 	 	 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 ' ,  
 	 	 T I M E S T A M P :   ' @ ' ,  
 	 	 W 3 C :   ' y y - m m - d d ' ,  
 	 	 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 ;  
 	 	 	 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  
 	 	 	 } ;  
 	 	 	 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  
 	 	 	 } ;  
 	 	 	 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  
 	 	 } ,  
 	 	 _ 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 ;  
 	 	 	 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 :   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 ]  
 	 	 } ,  
 	 	 _ 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 )  
 	 	 } ,  
 	 	 _ 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  
 	 	 } ,  
 	 	 _ 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 )  
 	 	 } ,  
 	 	 _ 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 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 ) )  
 	 	 	 }  
 	 	 } ,  
 	 	 _ 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 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 ( ) ) ) ;  
 	 	 	 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 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 + + )   {  
 	 	 	 	 	 	 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 ) ) ;  
 	 	 	 	 	 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 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 + + )   {  
 	 	 	 	 	 	 	 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 ' :   ' ' )   +   ( 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 ' :   ' ' )   +   ( ( 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 )   | |   ( 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 ( ) )   ?   '   '   +   t h i s . _ d a y O v e r C l a s s :   ' ' )   +   ( 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 ' :   ' ' )   +   ( 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 ]   +   ( 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 ( )   ?   '   '   +   t h i s . _ c u r r e n t C l a s s :   ' ' )   +   ( 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 ' :   ' ' ) )   +   ' " '   +   ( ( ! 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 ]   +   ' " ' :   ' ' )   +   ( 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 ; " ' )   +   ' > '   +   ( 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 ( )   :   '   ' )   :   ( 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 ( )   ?   '   u i - s t a t e - a c t i v e ' :   ' ' )   +   ' "   h r e f = " # " > '   +   p r i n t D a t e . g e t D a t e ( )   +   ' < / a > ' ) )   +   ' < / t d > ' ;  
 	 	 	 	 	 	 	 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   +   ( j Q u e r y . b r o w s e r . m s i e   & &   p a r s e I n t ( j Q u e r y . 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 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   =   ' ' ;  
 	 	 	 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 ) )   ?   '   ' :   ' ' ) ;  
 	 	 	 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   {  
 	 	 	 	 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   ?   '   ' :   ' ' )   +   m o n t h H t m l ;  
 	 	 	 h t m l   + =   ' < / d i v > ' ;  
 	 	 	 r e t u r n   h t m l  
 	 	 } ,  
 	 	 _ 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 ) ) ;  
 	 	 	 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 :   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 ] )  
 	 	 } ,  
 	 	 _ 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 ) )  
 	 	 } ,  
 	 	 _ 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 ) )  
 	 	 } ,  
 	 	 _ g e t D a y s I n M o n t h :   f u n c t i o n   ( y e a r ,   m o n t h )   {  
 	 	 	 r e t u r n   3 2   -   n e w   D a t e ( y e a r ,   m o n t h ,   3 2 ) . g e t D a t e ( )  
 	 	 } ,  
 	 	 _ g e 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 ( )  
 	 	 } ,  
 	 	 _ 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 I n R a n g e :   f u n c t i o n   ( i n s t ,   d a t e )   {  
 	 	 	 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 ) )  
 	 	 } ,  
 	 	 _ 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 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 ) )  
 	 	 }  
 	 } ) ;  
 	 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 )   {  
 	 	 j Q u e r y . 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  
 	 } ;  
 	 f u n c t i o n   i s A r r a y ( a )   {  
 	 	 r e t u r n   ( a   & &   ( ( j Q u e r y . 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 \ ( \ ) / ) ) ) )  
 	 } ;  
 	 j Q u e r y . 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 f ( ! j Q u e r y . d a t e p i c k e r . i n i t i a l i z e d )   {  
 	 	 	 j Q u e r y ( d o c u m e n t ) . m o u s e d o w n ( j Q u e r y . 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 ( j Q u e r y . d a t e p i c k e r . d p D i v ) ;  
 	 	 	 j Q u e r y . 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   j Q u e r y . 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 ( j Q u e r 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 ) ) ;  
 	 	 i f ( o p t i o n s   = =   ' o p t i o n '   & &   a r g u m e n t s . l e n g t h   = =   2   & &   t y p e o f   a r g u m e n t s [ 1 ]   = =   ' s t r i n g ' )   r e t u r n   j Q u e r y . 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 ( j Q u e r 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 '   ?   j Q u e r y . 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 ( j Q u e r 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 ) )   :   j Q u e r y . 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 )  
 	 	 } )  
 	 } ;  
 	 j Q u e r y . d a t e p i c k e r   =   n e w   D a t e p i c k e r ( ) ;  
 	 j Q u e r y . 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 ;  
 	 j Q u e r y . 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 ( ) ;  
 	 j Q u e r y . d a t e p i c k e r . v e r s i o n   =   " 1 . 7 . 2 " ;  
 	 w i n d o w . D P _ j Q u e r y   =   j Q u e r y  
 } ) ( j Q u e r y ) ; 
