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