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