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