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