ÿþ/ *   T h i s   s c r i p t   a n d   m a n y   m o r e   a r e   a v a i l a b l e   f r e e   o n l i n e   a t  
 T h e   J a v a S c r i p t   S o u r c e ! !   h t t p : / / j a v a s c r i p t . i n t e r n e t . c o m  
 C r e a t e d   b y :   K o n s t a n t i n   J a g e l l o   |   h t t p : / / j a v a s c r i p t - a r r a y . c o m /   * /  
 v a r   T i m e O u t                   =   3 0 0 ;  
 v a r   c u r r e n t L a y e r         =   n u l l ;  
 v a r   c u r r e n t i t e m           =   n u l l ;  
 v a r   c u r r e n t L a y e r N u m   =   0 ;  
 v a r   n o C l o s e                   =   0 ;  
 v a r   c l o s e T i m e r             =   n u l l ;  
  
 f u n c t i o n   m o p e n ( n )   {  
     v a r   l     =   d o c u m e n t . g e t E l e m e n t B y I d ( " m e n u " + n ) ;  
     v a r   m m   =   d o c u m e n t . g e t E l e m e n t B y I d ( " m m e n u " + n ) ;  
 	  
     i f ( l )   {  
         m c a n c e l c l o s e t i m e ( ) ;  
         l . s t y l e . v i s i b i l i t y = ' v i s i b l e ' ;  
         i f ( c u r r e n t L a y e r   & &   ( c u r r e n t L a y e r N u m   ! =   n ) )  
             c u r r e n t L a y e r . s t y l e . v i s i b i l i t y = ' h i d d e n ' ;  
         c u r r e n t L a y e r   =   l ;  
         c u r r e n t i t e m   =   m m ;  
         c u r r e n t L a y e r N u m   =   n ; 	 	 	  
     }   e l s e   i f ( c u r r e n t L a y e r )   {  
         c u r r e n t L a y e r . s t y l e . v i s i b i l i t y = ' h i d d e n ' ;  
         c u r r e n t L a y e r N u m   =   0 ;  
         c u r r e n t i t e m   =   n u l l ;  
         c u r r e n t L a y e r   =   n u l l ;  
   	 }  
 }  
  
 f u n c t i o n   m c l o s e t i m e ( )   {  
     c l o s e T i m e r   =   w i n d o w . s e t T i m e o u t ( m c l o s e ,   T i m e O u t ) ;  
 }  
  
 f u n c t i o n   m c a n c e l c l o s e t i m e ( )   {  
     i f ( c l o s e T i m e r )   {  
         w i n d o w . c l e a r T i m e o u t ( c l o s e T i m e r ) ;  
         c l o s e T i m e r   =   n u l l ;  
     }  
 }  
  
 f u n c t i o n   m c l o s e ( )   {  
     i f ( c u r r e n t L a y e r   & &   n o C l o s e ! = 1 )       {  
         c u r r e n t L a y e r . s t y l e . v i s i b i l i t y = ' h i d d e n ' ;  
         c u r r e n t L a y e r N u m   =   0 ;  
         c u r r e n t L a y e r   =   n u l l ;  
         c u r r e n t i t e m   =   n u l l ;  
     }   e l s e   {  
         n o C l o s e   =   0 ;  
     }  
     c u r r e n t L a y e r   =   n u l l ;  
     c u r r e n t i t e m   =   n u l l ;  
 }  
  
 d o c u m e n t . o n c l i c k   =   m c l o s e ;   
