ÿþ/ * * * * * * * * * * * * * * * * * * * * *  
 / / *   j Q u e r y   M u l t i   L e v e l   C S S   M e n u   # 2 -   B y   D y n a m i c   D r i v e :   h t t p : / / w w w . d y n a m i c d r i v e . c o m /  
 / / *   L a s t   u p d a t e :   N o v   7 t h ,   0 8 ' :   L i m i t   #   o f   q u e u e d   a n i m a t i o n s   t o   m i n m i z e   a n i m a t i o n   s t u t t e r i n g  
 / / *   M e n u   a v a i a b l e   a t   D D   C S S   L i b r a r y :   h t t p : / / w w w . d y n a m i c d r i v e . c o m / s t y l e /  
 * * * * * * * * * * * * * * * * * * * * * /  
  
 / / S p e c i f y   f u l l   U R L   t o   d o w n   a n d   r i g h t   a r r o w   i m a g e s   ( 2 3   i s   p a d d i n g - r i g h t   t o   a d d   t o   t o p   l e v e l   L I s   w i t h   d r o p   d o w n s ) :  
 v a r   a r r o w i m a g e s = { d o w n : [ ' d o w n a r r o w c l a s s ' ,   ' h t t p : / / i m g . w e b m e . c o m / p i c / o / o s m a n t a l a y / m e n u a r r o w . g i f ' ,   2 3 ] ,   r i g h t : [ ' r i g h t a r r o w c l a s s ' ,   ' h t t p : / / c i u d a d b l o g g e r . h o s t z i . c o m / I c o n s / m e n u - a r r o w - r i g h t . g i f ' ] }  
  
 v a r   j q u e r y s l i d e m e n u = {  
  
 a n i m a t e d u r a t i o n :   { o v e r :   2 0 0 ,   o u t :   1 0 0 } ,   / / d u r a t i o n   o f   s l i d e   i n /   o u t   a n i m a t i o n ,   i n   m i l l i s e c o n d s  
  
 b u i l d m e n u : f u n c t i o n ( m e n u i d ,   a r r o w s v a r ) {  
 	 j Q u e r y ( d o c u m e n t ) . r e a d y ( f u n c t i o n ( $ ) {  
 	 	 v a r   $ m a i n m e n u = $ ( " # " + m e n u i d + " > u l " )  
 	 	 v a r   $ h e a d e r s = $ m a i n m e n u . f i n d ( " u l " ) . p a r e n t ( )  
 	 	 $ h e a d e r s . e a c h ( f u n c t i o n ( i ) {  
 	 	 	 v a r   $ c u r o b j = $ ( t h i s )  
 	 	 	 v a r   $ s u b u l = $ ( t h i s ) . f i n d ( ' u l : e q ( 0 ) ' )  
 	 	 	 t h i s . _ d i m e n s i o n s = { w : t h i s . o f f s e t W i d t h ,   h : t h i s . o f f s e t H e i g h t ,   s u b u l w : $ s u b u l . o u t e r W i d t h ( ) ,   s u b u l h : $ s u b u l . o u t e r H e i g h t ( ) }  
 	 	 	 t h i s . i s t o p h e a d e r = $ c u r o b j . p a r e n t s ( " u l " ) . l e n g t h = = 1 ?   t r u e   :   f a l s e  
 	 	 	 $ s u b u l . c s s ( { t o p : t h i s . i s t o p h e a d e r ?   t h i s . _ d i m e n s i o n s . h + " p x "   :   0 } )  
 	 	 	 $ c u r o b j . c h i l d r e n ( " a : e q ( 0 ) " ) . c s s ( t h i s . i s t o p h e a d e r ?   { p a d d i n g R i g h t :   a r r o w s v a r . d o w n [ 2 ] }   :   { } ) . a p p e n d (  
 	 	 	 	 ' < i m g   s r c = " ' +   ( t h i s . i s t o p h e a d e r ?   a r r o w s v a r . d o w n [ 1 ]   :   a r r o w s v a r . r i g h t [ 1 ] )  
 	 	 	 	 + ' "   c l a s s = " '   +   ( t h i s . i s t o p h e a d e r ?   a r r o w s v a r . d o w n [ 0 ]   :   a r r o w s v a r . r i g h t [ 0 ] )  
 	 	 	 	 +   ' "   s t y l e = " b o r d e r : 0 ; "   / > '  
 	 	 	 )  
 	 	 	 $ c u r o b j . h o v e r (  
 	 	 	 	 f u n c t i o n ( e ) {  
 	 	 	 	 	 v a r   $ t a r g e t u l = $ ( t h i s ) . c h i l d r e n ( " u l : e q ( 0 ) " )  
 	 	 	 	 	 t h i s . _ o f f s e t s = { l e f t : $ ( t h i s ) . o f f s e t ( ) . l e f t ,   t o p : $ ( t h i s ) . o f f s e t ( ) . t o p }  
 	 	 	 	 	 v a r   m e n u l e f t = t h i s . i s t o p h e a d e r ?   0   :   t h i s . _ d i m e n s i o n s . w  
 	 	 	 	 	 m e n u l e f t = ( t h i s . _ o f f s e t s . l e f t + m e n u l e f t + t h i s . _ d i m e n s i o n s . s u b u l w > $ ( w i n d o w ) . w i d t h ( ) ) ?   ( t h i s . i s t o p h e a d e r ?   - t h i s . _ d i m e n s i o n s . s u b u l w + t h i s . _ d i m e n s i o n s . w   :   - t h i s . _ d i m e n s i o n s . w )   :   m e n u l e f t  
 	 	 	 	 	 i f   ( $ t a r g e t u l . q u e u e ( ) . l e n g t h < = 1 )   / / i f   1   o r   l e s s   q u e u e d   a n i m a t i o n s  
 	 	 	 	 	 	 $ t a r g e t u l . c s s ( { l e f t : m e n u l e f t + " p x " ,   w i d t h : t h i s . _ d i m e n s i o n s . s u b u l w + ' p x ' } ) . s l i d e D o w n ( j q u e r y s l i d e m e n u . a n i m a t e d u r a t i o n . o v e r )  
 	 	 	 	 } ,  
 	 	 	 	 f u n c t i o n ( e ) {  
 	 	 	 	 	 v a r   $ t a r g e t u l = $ ( t h i s ) . c h i l d r e n ( " u l : e q ( 0 ) " )  
 	 	 	 	 	 $ t a r g e t u l . s l i d e U p ( j q u e r y s l i d e m e n u . a n i m a t e d u r a t i o n . o u t )  
 	 	 	 	 }  
 	 	 	 )   / / e n d   h o v e r  
 	 	 } )   / / e n d   $ h e a d e r s . e a c h ( )  
 	 	 $ m a i n m e n u . f i n d ( " u l " ) . c s s ( { d i s p l a y : ' n o n e ' ,   v i s i b i l i t y : ' v i s i b l e ' } )  
 	 } )   / / e n d   d o c u m e n t . r e a d y  
 }  
 }  
  
 / / b u i l d   m e n u   w i t h   I D = " m y s l i d e m e n u "   o n   p a g e :  
 j q u e r y s l i d e m e n u . b u i l d m e n u ( " m y s l i d e m e n u " ,   a r r o w i m a g e s ) 
