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