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