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