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