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