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