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