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