ÿþ 
 f u n c t i o n   t e x t C o u n t e r ( f i e l d ,   c o u n t f i e l d ,   m a x l i m i t )  
 {  
       i f   ( f i e l d . v a l u e . l e n g t h   >   m a x l i m i t )  
               f i e l d . v a l u e   =   f i e l d . v a l u e . s u b s t r i n g ( 0 ,   m a x l i m i t ) ;        
       e l s e    
               c o u n t f i e l d . v a l u e   =   m a x l i m i t   -   f i e l d . v a l u e . l e n g t h ;  
 }  
  
 f u n c t i o n   I s E m p t y ( a T e x t F i e l d )   {  
       i f   ( ( a T e x t F i e l d . v a l u e . l e n g t h = = 0 )   | |  
       ( a T e x t F i e l d . v a l u e = = n u l l ) )   {  
             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   I s E m p t y O p t i o n ( a T e x t F i e l d )   {  
       i f   ( a T e x t F i e l d . s e l e c t e d I n d e x   = =   0 )   {  
             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   I s N u m e r i c ( a T e x t F i e l d )  
 {  
       v a r   V a l i d C h a r s   =   " 0 1 2 3 4 5 6 7 8 9 " ;  
       v a r   I s N u m b e r = t r u e ;  
       v a r   C h a r ;  
    
       f o r   ( i   =   0 ;   i   <   a T e x t F i e l d . v a l u e . l e n g t h   & &   I s N u m b e r   = =   t r u e ;   i + + )    
             {    
             C h a r   =   a T e x t F i e l d . v a l u e . c h a r A t ( i ) ;    
             i f   ( V a l i d C h a r s . i n d e x O f ( C h a r )   = =   - 1 )    
                   {  
                   I s N u m b e r   =   f a l s e ;  
                   }  
             }  
       r e t u r n   I s N u m b e r ;  
        
 }  
  
 / / - - - - - - - - - - - - - - - -  
 / /   S p i n n e r  
 / / - - - - - - - - - - - - - - - -  
  
 f u n c t i o n   s p i n n e r _ v a l i d a t i o n _ n o n _ m a n d a t o r y ( p a g e ,   q u e s t i o n ,   p r o m p t )  
 {  
       / /   A n d   L o g i c        
       v a r   v a l i d a t e d   =   1 ;  
       f o r ( v a r   i = 1 ;   i < = p r o m p t ;   i + + )  
       {  
           i f   ( ! I s E m p t y ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - " + i ) )    
             & &   ! I s N u m e r i c ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - " + i ) ) )  
           {       v a l i d a t e d   =   0 ;  
                   b r e a k ;  
           }                
       }  
        
     i f   ( v a l i d a t e d   = =   0 )  
     {        
           d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . i n n e r H T M L   =   " ÷‹kXeQcknx„vpeW[" ;            
           d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . c l a s s N a m e   =   " r e q u i r e d " ;            
           r e t u r n   f a l s e ;  
     }  
      
     r e t u r n   t r u e ;  
 }  
  
 / / - - - - - - - - - - - - - - - -  
 / /   C o n s t a n t _ s u m  
 / / - - - - - - - - - - - - - - - -  
  
 f u n c t i o n   c o n s t a n t _ s u m _ v a l i d a t i o n _ n o n _ m a n d a t o r y ( p a g e ,   q u e s t i o n ,   p r o m p t ,   t o t a l )  
 {  
       / /   A n d   L o g i c        
       v a r   v a l i d a t e d   =   1 ;  
       v a r   t o t a l _ n u m b e r   =   0  
       f o r ( v a r   i = 1 ;   i < = p r o m p t ;   i + + )  
       {  
           i f   ( ! I s E m p t y ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - " + i ) )    
             & &   ! I s N u m e r i c ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - " + i ) ) )  
           {       v a l i d a t e d   =   0 ;  
                   b r e a k ;  
           }  
       }      
      
     i f   ( v a l i d a t e d   = =   0 )  
     {        
           d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . i n n e r H T M L   =   " ÷‹kXeQcknx„vpeW[" ;            
           d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . c l a s s N a m e   =   " r e q u i r e d " ;            
           r e t u r n   f a l s e ;  
     }  
      
     r e t u r n   t r u e ;  
        
 }  
  
 / / - - - - - - - - - - - - - - - - - - - - - -  
 / /   S i n g l e _ c h o i c e _ m a t r i x  
 / / - - - - - - - - - - - - - - - - - - - - - -  
  
  
 / / - - - - - - - - - - - - - - - - - - - - - -  
 / /   D a t e  
 / / - - - - - - - - - - - - - - - - - - - - - -  
 f u n c t i o n   d a t e _ v a l i d a t i o n _ n o n _ m a n d a t o r y ( p a g e ,   q u e s t i o n ,   p r o m p t )  
 {  
     / /   A n d   L o g i c  
     v a r   v a l i d a t e d   = 1 ;  
     f o r ( v a r   i = 1 ;   i < = p r o m p t ;   i + + )  
     {              
         v a r   b o x   =   d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - " + i + " _ m o n t h " ) ;  
         v a r   m o n t h   =   b o x . o p t i o n s [ b o x . s e l e c t e d I n d e x ] . v a l u e ;  
         b o x   =   d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - " + i + " _ d a y " ) ;  
         v a r   d a y   =   b o x . o p t i o n s [ b o x . s e l e c t e d I n d e x ] . v a l u e ;  
         b o x   =   d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - " + i + " _ y e a r " ) ;  
         v a r   y e a r   =   b o x . o p t i o n s [ b o x . s e l e c t e d I n d e x ] . v a l u e ;  
  
         i f   ( y e a r   ! =   " "   | |   m o n t h   ! =   " "   | |   d a y   ! =   " " )  
         {  
                 i f   ( ! i s D a t e ( m o n t h + " / "   +   d a y   +   " / "   +   y e a r ) ) 	  
 	         {                          
                         v a l i d a t e d   =   0 ;  
                         b r e a k ;  
                 }      
         }  
     }  
      
     i f   ( v a l i d a t e d   = =   0 )  
     {  
             d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . i n n e r H T M L   =   " ÷‹kXeQcknx„vöeô•" ;            
             d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . c l a s s N a m e   =   " r e q u i r e d " ;            
             r e t u r n   f a l s e ;  
     }  
      
     r e t u r n   t r u e ;  
      
 }  
  
 / / - - - - - - - - - - - - - - - -  
 / /   s i n g l e _ c h o i c e  
 / / - - - - - - - - - - - - - - - -  
  
 f u n c t i o n   s i n g l e _ c h o i c e _ v a l i d a t i o n _ n o n _ m a n d a t o r y ( p a g e , q u e s t i o n , p r o m p t )  
 {                  
         i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ " + p r o m p t ) . v a l u e   <   0  
           & &   I s E m p t y ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ o p e n _ e n d e d " ) )   )  
         {  
               d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . i n n e r H T M L   =   " ÷‹kXeQøv”^„v‡eW[" ;            
               d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . c l a s s N a m e   =   " r e q u i r e d " ;            
               r e t u r n   f a l s e ;  
         }      
          
         r e t u r n   t r u e ;  
 }  
  
 / / - - - - - - - - - - - - - - - -  
 / /   M u l t i _ c h o i c e  
 / / - - - - - - - - - - - - - - - -  
 f u n c t i o n   m u l t i _ c h o i c e _ v a l i d a t i o n _ n o n _ m a n d a t o r y ( p a g e ,   q u e s t i o n ,   p r o m p t )  
 {  
     i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - 1 " )   ! =   n u l l )  
     {  
           i f   ( ! I s E m p t y ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ - 1 " ) )  
               & &   I s E m p t y ( d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n + " _ o p e n _ e n d e d " ) ) )  
           {  
                   d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . i n n e r H T M L   =   " ÷‹kXeQøv”^„v‡eW[" ;            
                   d o c u m e n t . g e t E l e m e n t B y I d ( " q _ " + p a g e + " _ " + q u e s t i o n +   " _ m s g " ) . c l a s s N a m e   =   " r e q u i r e d " ;            
                   r e t u r n   f a l s e ;  
           }                    
     }          
      
     r e t u r n   t r u e ;        
      
 }  
  
 / / - - - - - - - - - - - - - - - -  
 / /   d r o p d o w n l i s t  
 / / - - - - - - - - - - - - - - - -  
  
 / / - - - - - - - - - - - - - - - -  
 / /   c o m m e n t s  
 / / - - - - - - - - - - - - - - - -  
  
 / / - - - - - - - - - - - - - - - -  
 / /   S i n g l e _ L i n e  
 / / - - - - - - - - - - - - - - - -  
  
  
 / / - - - - - - - - - - - - - - - - - - - -  
 / /   M u l t i _ c h o i c e _ m a t r i x  
 / / - - - - - - - - - - - - - - - - - - - -  
  
  
 
