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