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