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