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