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