ÿþv a r   i s R e c e n t S e a r c h D i v O p e n   =   f a l s e ;   v a r   i s S h o p p i n g C a r t D i v O p e n   =   f a l s e ;   f u n c t i o n   R e c e n t S e a r c h e s T a b S e l e c t ( e l t )   {  
         i f   ( i s R e c e n t S e a r c h D i v O p e n   = =   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 ( ' r e c e n t s e a r c h t a b l e f t ' ) . c l a s s N a m e   =   " r e c e n t s e a r c h - t a b - s e l - l e f t " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b m i d d l e ' ) . c l a s s N a m e   =   " r e c e n t s e a r c h - t a b - s e l - m i d d l e " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b r i g h t ' ) . c l a s s N a m e   =   " r e c e n t s e a r c h - t a b - s e l - r i g h t " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' R e c e n t S e a r c h e s C o n t a i n e r ' ) . s t y l e . d i s p l a y   =   ' ' ;   v a r   p o s i t i o n   =   f i n d P o s X ( d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b m i d d l e ' ) )   -   6 0 0 ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' R e c e n t S e a r c h e s C o n t a i n e r ' ) . s t y l e . l e f t   =   p o s i t i o n   +   " p x " ;   S h o p p i n g C a r t D I V C l o s e ( ) ;   L o g O n D I V C l o s e ( ) ;   i s R e c e n t S e a r c h D i v O p e n   =   t r u e ;   }  
         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 ( ' R e c e n t S e a r c h e s C o n t a i n e r ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b l e f t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b m i d d l e ' ) . c l a s s N a m e   =   " b a n n e r - t o p - n a v i g a t i o n - l a r g e " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b r i g h t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n D I V ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   i s R e c e n t S e a r c h D i v O p e n   =   f a l s e ;   }    
 }  
 f u n c t i o n   I m a g e N a v R o l l O u t ( r o w i d )   {  
         i f   ( r o w i d   = =   " t a b 6 "   | |   r o w i d   = =   " t a b 9 4 " )  
                 d o c u m e n t . g e t E l e m e n t B y I d ( r o w i d ) . c l a s s N a m e   =   " i m a g e - n a v - t a b - l a s t " ;   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 ( r o w i d ) . c l a s s N a m e   =   " i m a g e - n a v - t a b " ;  
 }  
 f u n c t i o n   C h o o s e A d d r r e s s ( e l t ,   h i d d e n f i e l d 1 )   {  
         v a r   e l t R D O   =   d o c u m e n t . g e t E l e m e n t B y I d ( e l t ) ;   v a r   e l t H i d d e n f i e l d   =   d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n f i e l d 1 ) ;   i f   ( e l t R D O   = =   n u l l   | |   e l t H i d d e n f i e l d   = =   n u l l )  
         {   r e t u r n ;   }  
         e l t H i d d e n f i e l d . v a l u e   =   - 1 ;   v a r   r d o C o u n t   =   e l t R D O . r o w s . l e n g t h ;   f o r   ( i t e r a t o r   =   0 ;   i t e r a t o r   <   r d o C o u n t ;   i t e r a t o r + + )   {  
                 i f   ( e l t R D O . r o w s [ i t e r a t o r ] . c e l l s [ 0 ] . c h i l d N o d e s [ 0 ] . c h e c k e d )  
                 {   e l t H i d d e n f i e l d . v a l u e   =   i t e r a t o r ;   b r e a k ;   }    
         }    
 }  
 f u n c t i o n   R e c e n t S e a r c h e s D I V C l o s e ( )  
 {   d o c u m e n t . g e t E l e m e n t B y I d ( ' R e c e n t S e a r c h e s C o n t a i n e r ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b l e f t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b m i d d l e ' ) . c l a s s N a m e   =   " b a n n e r - t o p - n a v i g a t i o n - l a r g e " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' r e c e n t s e a r c h t a b r i g h t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n D I V ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   i s R e c e n t S e a r c h D i v O p e n   =   f a l s e ;   }  
 f u n c t i o n   S h o p p i n g C a r t T a b S e l e c t ( e l t )   {  
         i f   ( i s S h o p p i n g C a r t D i v O p e n   = =   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 ( ' s h o p p i n g t a b l e f t ' ) . c l a s s N a m e   =   " s h o p p i n g c a r t - t a b - s e l - l e f t " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b m i d d l e ' ) . c l a s s N a m e   =   " s h o p p i n g c a r t - t a b - s e l - m i d d l e " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b r i g h t ' ) . c l a s s N a m e   =   " s h o p p i n g c a r t - t a b - s e l - r i g h t " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' S h o p p i n g C a r t C o n t a i n e r ' ) . s t y l e . d i s p l a y   =   ' ' ;   v a r   p o s i t i o n   =   f i n d P o s X ( d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b m i d d l e ' ) )   -   6 2 0 ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' S h o p p i n g C a r t C o n t a i n e r ' ) . s t y l e . l e f t   =   p o s i t i o n   +   " p x " ;   R e c e n t S e a r c h e s D I V C l o s e ( ) ;   L o g O n D I V C l o s e ( ) ;   i s S h o p p i n g C a r t D i v O p e n   =   t r u e ;   }  
         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 ( ' S h o p p i n g C a r t C o n t a i n e r ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b l e f t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b m i d d l e ' ) . c l a s s N a m e   =   " b a n n e r - t o p - n a v i g a t i o n - l a r g e " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b r i g h t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n D I V ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   i s S h o p p i n g C a r t D i v O p e n   =   f a l s e ;   }    
 }  
 f u n c t i o n   S h o p p i n g C a r t D I V C l o s e ( )  
 {   d o c u m e n t . g e t E l e m e n t B y I d ( ' S h o p p i n g C a r t C o n t a i n e r ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b l e f t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b m i d d l e ' ) . c l a s s N a m e   =   " b a n n e r - t o p - n a v i g a t i o n - l a r g e " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' s h o p p i n g t a b r i g h t ' ) . c l a s s N a m e   =   " " ;   d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n D I V ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   i s S h o p p i n g C a r t D i v O p e n   =   f a l s e ;   }  
 f u n c t i o n   T a b S h o p M N J ( c u r r e n t T a b )   {  
         i f   ( c u r r e n t T a b   ! =   " H o m e " )  
         {   j a v a s c r i p t :   _ _ d o P o s t B a c k ( " H o m e " ,   " " ) ;   }    
 }  
 f u n c t i o n   T a b M y A c c o u n t ( c u r r e n t T a b )   {  
         i f   ( c u r r e n t T a b   ! =   " M y A c c o u n t " )  
         {   j a v a s c r i p t :   _ _ d o P o s t B a c k ( " M y A c c o u n t " ,   " " ) ;   }    
 }  
 f u n c t i o n   B u t t o n R o l l O v e r ( r o w ,   e f f e c t )   {  
         i f   ( r o w . a l l )   {  
                 i f   ( e f f e c t   = =   1 )  
                 {   r o w . c e l l s [ 0 ] . c l a s s N a m e   =   " b u t t o n - l e f t - c u r v e - h o v e r " ;   r o w . c e l l s [ 1 ] . c l a s s N a m e   =   " b u t t o n - m i d d l e - h o v e r " ;   r o w . c e l l s [ 2 ] . c l a s s N a m e   =   " b u t t o n - r i g h t - c u r v e - h o v e r " ;   }   e l s e  
                 {   r o w . c e l l s [ 0 ] . c l a s s N a m e   =   " b u t t o n - l e f t - c u r v e " ;   r o w . c e l l s [ 1 ] . c l a s s N a m e   =   " b u t t o n - m i d d l e " ;   r o w . c e l l s [ 2 ] . c l a s s N a m e   =   " b u t t o n - r i g h t - c u r v e " ;   }    
         }   e l s e   {  
                 i f   ( e f f e c t   = =   1 )  
                 {   r o w . c h i l d N o d e s . i t e m ( 1 ) . c l a s s N a m e   =   " b u t t o n - l e f t - c u r v e - h o v e r " ;   r o w . c h i l d N o d e s . i t e m ( 3 ) . c l a s s N a m e   =   " b u t t o n - m i d d l e - h o v e r " ;   r o w . c h i l d N o d e s . i t e m ( 5 ) . c l a s s N a m e   =   " b u t t o n - r i g h t - c u r v e - h o v e r " ;   }   e l s e  
                 {   r o w . c h i l d N o d e s . i t e m ( 1 ) . c l a s s N a m e   =   " b u t t o n - l e f t - c u r v e " ;   r o w . c h i l d N o d e s . i t e m ( 3 ) . c l a s s N a m e   =   " b u t t o n - m i d d l e " ;   r o w . c h i l d N o d e s . i t e m ( 5 ) . c l a s s N a m e   =   " b u t t o n - r i g h t - c u r v e " ;   }    
         }    
 }  
 f u n c t i o n   I m a g e N a v R o l l O v e r ( r o w i d )   {  
         i f   ( r o w i d   = =   " t a b 6 "   | |   r o w i d   = =   " t a b 9 4 " )  
                 d o c u m e n t . g e t E l e m e n t B y I d ( r o w i d ) . c l a s s N a m e   =   " i m a g e - n a v - t a b - l a s t - h o v e r " ;   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 ( r o w i d ) . c l a s s N a m e   =   " i m a g e - n a v - t a b - h o v e r " ;  
 }  
 f u n c t i o n   I m a g e N a v R o l l O v e r ( r o w i d )   {  
         i f   ( r o w i d   = =   " t a b 6 "   | |   r o w i d   = =   " t a b 9 4 " )  
                 d o c u m e n t . g e t E l e m e n t B y I d ( r o w i d ) . c l a s s N a m e   =   " i m a g e - n a v - t a b - l a s t - h o v e r " ;   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 ( r o w i d ) . c l a s s N a m e   =   " i m a g e - n a v - t a b - h o v e r " ;  
 }  
 f u n c t i o n   S h o w W e l c o m e T e x t ( t e x t i d s h o w ,   t e x t i d h i d e 1 ,   t e x t i d h i d e 2 ,   t e x t i d h i d e 3 ,   t e x t i d h i d e 4 ,   t e x t i d h i d e 5 )  
 {   d o c u m e n t . g e t E l e m e n t B y I d ( t e x t i d s h o w ) . s t y l e . d i s p l a y   =   ' ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( t e x t i d h i d e 1 ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( t e x t i d h i d e 2 ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( t e x t i d h i d e 3 ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( t e x t i d h i d e 4 ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   d o c u m e n t . g e t E l e m e n t B y I d ( t e x t i d h i d e 5 ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   }  
 f u n c t i o n   L o g O n D I V O p e n ( t x t U s e r N a m e )   {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n D I V ' ) . s t y l e . d i s p l a y   =   ' ' ;   v a r   t x t B o x 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t U s e r N a m e ) ;   i f   ( t x t B o x 1   ! =   n u l l   & &   t x t B o x 1 . s t y l e . d i s p l a y   ! =   ' n o n e ' )  
         {   t x t B o x 1 . f o c u s ( ) ;   }  
         r e t u r n   f a l s e ;  
 }  
 f u n c t i o n   L o g O n D I V C l o s e ( )  
 {   d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n D I V ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;   }  
 f u n c t i o n   L o a d D e f a u l t S e t t i n g s ( )  
 {   }  
 f u n c t i o n   L o a d D e f a u l t S e t t i n g s 1 ( )  
 {   }  
 f u n c t i o n   I m a g e B u t t o n M o u s e O v e r ( b u t t o n ,   t y p e )   {  
         i f   ( t y p e   = =   " P " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ p r e v i e w . j p g " ;   e l s e   i f   ( t y p e   = =   " S " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ s u b m i t _ h o v e r . g i f " ;   e l s e   i f   ( t y p e   = =   " C " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ c a n c e l _ h o v e r . g i f " ;   e l s e   i f   ( t y p e   = =   " X " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ c l o s e _ h o v e r . g i f " ;   e l s e   i f   ( t y p e   = =   " M " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ m o r e _ h o v e r . g i f " ;  
 }  
 f u n c t i o n   I m a g e B u t t o n M o u s e O u t ( b u t t o n ,   t y p e )   {  
         i f   ( t y p e   = =   " P " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ p r e v i e w . j p g " ;   e l s e   i f   ( t y p e   = =   " S " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ s u b m i t . g i f " ;   e l s e   i f   ( t y p e   = =   " C " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ c a n c e l . g i f " ;   e l s e   i f   ( t y p e   = =   " X " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ c l o s e . g i f " ;   e l s e   i f   ( t y p e   = =   " M " )  
                 b u t t o n . s r c   =   " . . / . . / T h e m e s / D e f a u l t / I m a g e s / b t n _ m o r e _ d o w n . g i f " ;  
 }  
 f u n c t i o n   S c r o l l T o E l e m e n t ( i m g I d )   {  
         v a r   t h e E l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( i m g I d ) ;   v a r   s e l e c t e d P o s X   =   0 ;   v a r   s e l e c t e d P o s Y   =   0 ;   w h i l e   ( t h e E l e m e n t   ! =   n u l l )  
         {   s e l e c t e d P o s X   + =   t h e E l e m e n t . o f f s e t L e f t ;   s e l e c t e d P o s Y   + =   t h e E l e m e n t . o f f s e t T o p ;   t h e E l e m e n t   =   t h e E l e m e n t . o f f s e t P a r e n t ;   }  
         w i n d o w . s c r o l l T o ( s e l e c t e d P o s X ,   s e l e c t e d P o s Y ) ;  
 }  
 f u n c t i o n   I t e m E x i s t s I n L i s t ( d d l n a m e ,   v a l u e )   {  
         v a r   l i s t 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 ( d d l n a m e ) ;   f o r   ( i n d e x 1   =   0 ;   i n d e x 1   <   d d l n a m e . o p t i o n s . l e n g t h ;   i n d e x 1 + + )   {  
                 i f   ( d d l n a m e [ i n d e x 1 ] . v a l u e   = =   v a l u e )  
                  
                 {   r e t u r n   t r u e ;   b r e a k ;   }    
         }  
         r e t u r n   f a l s e ;  
 }  
 f u n c t i o n   A d d I t e m T o L i s t ( d d l ,   t e x t ,   v a l u e )  
 {   v a r   o p t   =   d o c u m e n t . c r e a t e E l e m e n t ( " o p t i o n " ) ;   o p t . t e x t   =   t e x t ;   o p t . v a l u e   =   v a l u e ;   d d l . o p t i o n s . a d d ( o p t ) ;   }  
 f u n c t i o n   R e m o v e I t e m F r o m L i s t ( d d l ,   v a l u e )   {  
         f o r   ( i n d e x 1   =   0 ;   i n d e x 1   <   d d l . o p t i o n s . l e n g t h ;   i n d e x 1 + + )   {  
                 i f   ( d d l . o p t i o n s [ i n d e x 1 ] . v a l u e   = =   v a l u e )  
                 {   d d l . o p t i o n s [ i n d e x 1 ]   =   n u l l ;   b r e a k ;   }    
         }    
 }  
 f u n c t i o n   s e l e c t I t e m ( d d l n a m e ,   v a l u e )   {  
         v a r   l i s t 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 ( d d l n a m e ) ;   f o r   ( i n d e x 1   =   0 ;   i n d e x 1   <   l i s t B o x . o p t i o n s . l e n g t h ;   i n d e x 1 + + )   {  
                 i f   ( l i s t B o x [ i n d e x 1 ] . v a l u e   = =   v a l u e )  
                 {   l i s t B o x [ i n d e x 1 ] . s e l e c t e d   =   t r u e ;   b r e a k ;   }    
         }    
 }  
 v a r   a r r C o m p a r e   =   n e w   A r r a y ( ) ;   v a r   a r r C h k I D s   =   ' ' ;   f u n c t i o n   M o r e C l i c k e d ( i m a g e ,   d i v I d )   {  
         v a r   d i v   =   d o c u m e n t . g e t E l e m e n t B y I d ( d i v I d ) ;   v a r   l b l   =   i m a g e . p a r e n t N o d e . c h i l d N o d e s [ 3 ] ;   i f   ( i m a g e . s r c . i n d e x O f ( " p l u s " )   >   0 )  
         {   i m a g e . s r c   =   i m a g e . s r c . r e p l a c e ( " p l u s " ,   " m i n u s " ) ;     t r y   {   l b l . i n n e r H T M L   =   " V i e w   F e w e r " ;   }   c a t c h   ( e r r )   {   i m a g e . p a r e n t N o d e . c h i l d N o d e s [ 2 ] . i n n e r H T M L   =   " V i e w   F e w e r " ;   }   }  
         e l s e  
         {   i m a g e . s r c   =   i m a g e . s r c . r e p l a c e ( " m i n u s " ,   " p l u s " ) ;     t r y   {   l b l . i n n e r H T M L   =   " V i e w   M o r e " ;   }   c a t c h   ( e r r )   {   i m a g e . p a r e n t N o d e . c h i l d N o d e s [ 2 ] . i n n e r H T M L   =   " V i e w   M o r e " ;   }   }    
 }  
 f u n c t i o n   C o m p a r e C l i c k e d ( m a x P r o d u c t C o u n t )   {  
  
         v a r   p r o d u c t C o u n t   =   4 ;  
         i f   ( m a x P r o d u c t C o u n t   ! =   n u l l )   {  
  
                 p r o d u c t C o u n t   =   m a x P r o d u c t C o u n t ;  
         }  
         i f   ( a r r C o m p a r e . l e n g t h   <   2 )  
                 a l e r t ( ' P l e a s e   s e l e c t   a t l e a s t   t w o   p r o d u c t   t o   c o m p a r e . ' ) ;   e l s e   i f   ( a r r C o m p a r e . l e n g t h   >   p r o d u c t C o u n t )  
                 a l e r t ( " Y o u   c a n ' t   c o m p a r e   m o r e   t h a n   "   +   p r o d u c t C o u n t   +   "   i t e m s   a t   a   t i m e . " ) ;   e l s e   {  
                 v a r   c o m m a S e p e r a t e d P r o d u c t I d   =   " " ;   f o r   ( v a r   i n d e x   =   0 ;   i n d e x   <   a r r C o m p a r e . l e n g t h ;   i n d e x + + )   {  
                         i f   ( i n d e x   = =   0 )  
                                 c o m m a S e p e r a t e d P r o d u c t I d   =   a r r C o m p a r e [ i n d e x ]   +   " , " ;   e l s e  
                                 c o m m a S e p e r a t e d P r o d u c t I d   =   c o m m a S e p e r a t e d P r o d u c t I d   +   a r r C o m p a r e [ i n d e x ]   +   " , " ;  
                 }  
                 c o m m a S e p e r a t e d P r o d u c t I d   =   c o m m a S e p e r a t e d P r o d u c t I d . s u b s t r i n g ( 0 ,   c o m m a S e p e r a t e d P r o d u c t I d . l e n g t h   -   1 ) ;   v a r   c h k I D s   =   a r r C h k I D s . s p l i t ( ' , ' ) ;   v a r   l e n g t h 1   =   c h k I D s . l e n g t h ;   f o r   ( v a r   i n d e x   =   0 ;   i n d e x   <   l e n g t h 1 ;   i n d e x + + )   {  
                         i f   ( c h k I D s [ i n d e x ]   = =   ' ' )  
                                 c o n t i n 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 h k I D s [ i n d e x ] ) . c h e c k e d   =   f a l s e ;  
                 }  
                 a r r C h k I D s   =   ' ' ;   _ _ d o P o s t B a c k ( ' C o m p a r e P r o d u c t ' ,   c o m m a S e p e r a t e d P r o d u c t I d ) ;  
         }  
         r e t u r n   f a l s e ;  
 }  
 f u n c t i o n   C o m p a r e C h e c k e d ( e l t ,   p r o d u c t I d ,   h i d I D ,   m a x P r o d u c t C o u n t )   {  
         v a r   p r o d u c t C o u n t   =   4 ;  
         i f   ( m a x P r o d u c t C o u n t   ! =   n u l l )   {  
  
                 p r o d u c t C o u n t   =   m a x P r o d u c t C o u n t ;  
         }  
         i f   ( e l t . c h e c k e d   = =   t r u e )   {  
                 i f   ( a r r C h k I D s   = =   ' ' )  
                 {   a r r C h k I D s   =   e l t . i d ;   }  
                 e l s e  
                 {   a r r C h k I D s   + =   ' , '   +   e l t . i d ;   }  
                 i f   ( a r r C o m p a r e . l e n g t h   >   ( p r o d u c t C o u n t   -   1 ) )  
                 {   a l e r t ( " Y o u   c a n ' t   c o m p a r e   m o r e   t h a n   "   +   p r o d u c t C o u n t   +   "   i t e m s   a t   a   t i m e . " ) ;   r e t u r n   f a l s e ;   }  
                 v a r   f o u n d   =   f a l s e ;   f o r   ( v a r   i n d e x   =   0 ;   i n d e x   <   a r r C o m p a r e . l e n g t h ;   i n d e x + + )   {  
                         i f   ( a r r C o m p a r e [ i n d e x ]   = =   p r o d u c t I d )  
                                 f o u n d   =   t r u e ;  
                 }  
                 i f   ( ! f o u n d )  
                         a r r C o m p a r e [ a r r C o m p a r e . l e n g t h ]   =   p r o d u c t I d ;  
         }  
         e l s e   {  
                 v a r   a r r T e m p   =   n e w   A r r a y ( ) ;   a r r C h k I D s   =   a r r C h k I D s . r e p l a c e ( e l t . i d ,   " " ) ;   a r r C h k I D s   =   a r r C h k I D s . r e p l a c e ( / , , / ,   " , " ) ;   f o r   ( v a r   i n d e x   =   0 ;   i n d e x   <   a r r C o m p a r e . l e n g t h ;   i n d e x + + )   {  
                         i f   ( a r r C o m p a r e [ i n d e x ]   ! =   p r o d u c t I d )  
                                 a r r T e m p [ a r r T e m p . l e n g t h ]   =   a r r C o m p a r e [ i n d e x ] ;  
                 }  
                 a r r C o m p a r e   =   n u l l ;   a r r C o m p a r e   =   a r r T e m p ;  
         }  
         v a r   h i d P r o d u c t s S e l e c t e d   =   d o c u m e n t . g e t E l e m e n t B y I d ( h i d I D ) ;   i f   ( h i d P r o d u c t s S e l e c t e d   ! =   n u l l )  
         {   h i d P r o d u c t s S e l e c t e d . v a l u e   =   a r r C o m p a r e ;   }    
 }  
 f u n c t i o n   H i d e I m a g e ( c h k I d ,   e l t I d s )   {  
         v a r   c h k   =   d o c u m e n t . g e t E l e m e n t B y I d ( c h k I d ) ;   v a r   a r r I d s   =   e l t I d s . s p l i t ( " | " ) ;   v a r   s h o w   =   f a l s e ;   i f   ( c h k . c h e c k e d   = =   t r u e )  
                 s h o w   =   t r u e ;   f o r   ( v a r   i n d e x   =   0 ;   i n d e x   <   a r r I d s . l e n g t h ;   i n d e x + + )   {  
                 i f   ( s h o w )  
                         d o c u m e n t . g e t E l e m e n t B y I d ( a r r I d s [ i n d e x ] ) . s t y l e . d i s p l a y   =   " n o n e " ;   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 ( a r r I d s [ i n d e x ] ) . s t y l e . d i s p l a y   =   " " ;  
         }    
 }  
 f u n c t i o n   S e t S o r t E x p r ( v a l u e )   {  
         i f   ( p r o d u c t S e a r c h P a g e I d s   ! =   u n d e f i n e d )  
                 d o c u m e n t . g e t E l e m e n t B y I d ( p r o d u c t S e a r c h P a g e I d s [ 0 ] ) . v a l u e   =   v a l u e ;  
 }  
 f u n c t i o n   c h e c k E m a i l ( e m a i l )   {  
         v a r   t e s t E m a i l   =   / ^ ( [ a - z A - Z 0 - 9 ] ) + ( [ a - z A - Z 0 - 9 _ . ] ) * @ ( [ a - z A - Z 0 - 9 ] ) + ( [ a - z A - Z 0 - 9 _ . - ] ) * \ . ( [ a - z A - Z ] ) + ( [ a - z A - Z ] ) + / ;   i f   ( t e s t E m a i l . t e s t ( e m a i l )   = =   t r u 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   d e l e t e R e m i n d e r ( b t n ,   d d l ,   r e m i n d e r I D ,   r e m i n d e r N a m e ,   u s e r I D ,   l b l , c u s t o m e r I D )  
 {   b t n . d i s a b l e d   =   t r u e ;   d o c u m e n t . g e t E l e m e n t B y I d ( d d l ) . d i s a b l e d   =   t r u e ;   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 ) . i n n e r H T M L   =   " u p d a t e d . " ;   v a r   v a l u e s   =   u s e r I D   +   ' | | | '   +   r e m i n d e r I D   +   ' | | | '   +   r e m i n d e r N a m e +   ' | | | '   +   c u s t o m e r I D   ;   D o A j a x C a l l F o r R e m i n d e r s ( v a l u e s ) ;   r e t u r n   f a l s e ;   }  
 f u n c t i o n   A d d D a y s T o R e m i n d e r ( b t n ,   d d l ,   r e m i n d e r I D ,   r e m i n d e r N a m e ,   u s e r I D ,   l b l )  
 {   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 ) . d i s a b l e d   =   t r u e ;   d o c u m e n t . g e t E l e m e n t B y I d ( d d l ) . d i s a b l e d   =   t r u e ;   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 ) . i n n e r H T M L   =   " u p d a t e d . " ;   v a r   v a l u e s   =   u s e r I D   +   ' | | | '   +   r e m i n d e r I D   +   ' | | | '   +   d o c u m e n t . g e t E l e m e n t B y I d ( d d l ) . v a l u e ;   v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " A d d D a y s T o R e m i n d e r = "   +   v a l u e s ;   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;   r e t u r n   f a l s e ;   }  
 f u n c t i o n   D o A j a x C a l l F o r R e m i n d e r s ( v a l u e s )  
 {   v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " d e l e t e R e m i n d e r = "   +   v a l u e s ;   r e t u r n   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;   }  
 f u n c t i o n   A d d P r o d u c t T o C a r t ( p r o d u c t I d )  
 {   v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " a d d P r o d u c t T o C a r t = "   +   p r o d u c t I d ;   _ _ d o P o s t B a c k ( ' A d d P r o d u c t T o C a r t ' ,   p r o d u c t I d ) ;   r e t u r n   f a l s e ;   }  
 f u n c t i o n   A d d P r o d u c t T o C a r t A j a x C a l l ( p r o d u c t I d )  
 {   v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " a d d P r o d u c t T o C a r t = "   +   p r o d u c t I d ;   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;   w i n d o w . l o c a t i o n   =   " . . / . . / U I / C a r t s / S h o p p i n g C a r t . a s p x " ;   }  
 f u n c t i o n   A d d B u n d l e T o C a r t ( b u n d l e I d )  
 {   v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " a d d B u n d l e T o C a r t = "   +   b u n d l e I d ;   _ _ d o P o s t B a c k ( ' A d d B u n d l e T o C a r t ' ,   b u n d l e I d ) ;   r e t u r n   f a l s e ;   }  
 v a r   t b l R u l e I D C l i e n t I D   =   ' e e e ' ;   v a r   t o t a l A d d e d T o R i g h t   =   0 ;   v a r   c h e c k e d L e f t   =   0 ;   v a r   c h e c k e d R i g h t   =   0 ;   v a r   t o t a l R u l e s C h e c k e d   =   0 ;   v a r   t o t a l W o r k F l o w s C h e c k e d   =   0 ;   f u n c t i o n   C a n c e l A l l C h a n g e s ( )   {  
         i f   ( ! c o n f i r m ( ' Y o u r   a l l   u n s a v e d   c h a n g e s   w i l l   b e   l o s t . D o   y o u   w a n t   t o   c o n t i n u 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   S e t A c t i v e t d ( d d l R u l e N a m e ,   t d N e e d s A p p r o v a l I D ,   t d S e t S p e c i f i c B r a n d I D ,   t d S e t S p e c i f i c C a t e g o r y I D ,   t d S e t S p e c i f i c P r o d u c t I D ,   t d S e t R u l e V a l u e I D ,   l b l D o l l a r S i g n I D ,   v a l i d a t o r I D s )   {  
         v a r   t d N e e d s A p p r o 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 ( t d N e e d s A p p r o v a l I D ) ;   v a r   t d S e t S p e c i f i c B r a n d   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d S e t S p e c i f i c B r a n d I D ) ;   v a r   t d S e t S p e c i f i c C a t e g o r y   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d S e t S p e c i f i c C a t e g o r y I D ) ;   v a r   t d S e t S p e c i f i c P r o d u c t   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d S e t S p e c i f i c P r o d u c t I D ) ;   v a r   t d S e t R u l e 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 ( t d S e t R u l e V a l u e I D ) ;   v a r   l b l D o l l a r S i g n   =   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 D o l l a r S i g n I D ) ;   v a r   v a l i d a t o r I d L i s t   =   v a l i d a t o r I D s . s p l i t ( ' | | | ' ) ;   v a r   i n d e x   =   0 ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   v a l i d a t o r I d L i s t   ! =   u n d e f i n e d )   {  
                 f o r   ( i n d e x   =   0 ;   i n d e x   <   v a l i d a t o r I d L i s t . l e n g t h ;   i n d e x + + )  
                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ i n d e x ] ) ,   f a l s e ) ;   }    
         }  
         i f   ( t d N e e d s A p p r o v a l   ! =   n u l l   & &   t d S e t S p e c i f i c B r a n d   ! =   n u l l   & &   t d S e t S p e c i f i c C a t e g o r y   ! =   n u l l   & &   t d S e t S p e c i f i c P r o d u c t   ! =   n u l l   & &   t d S e t R u l e V a l u e   ! =   n u l l   & &   l b l D o l l a r S i g n   ! =   n u l l )  
         {   t d S e t S p e c i f i c B r a n d . s t y l e . d i s p l a y   =   ' n o n e ' ;   t d S e t S p e c i f i c C a t e g o r y . s t y l e . d i s p l a y   =   ' n o n e ' ;   t d S e t S p e c i f i c P r o d u c t . s t y l e . d i s p l a y   =   ' n o n e ' ;   t d S e t R u l e V a l u e . s t y l e . d i s p l a y   =   ' n o n e ' ;   t d N e e d s A p p r o v a l . s t y l e . d i s p l a y   =   ' n o n e ' ;   l b l D o l l a r S i g n . i n n e r H T M L   =   ' ' ;   }  
         i f   ( d d l R u l e N a m e   ! =   n u l l )   {  
                 s w i t c h   ( d d l R u l e N a m e . o p t i o n s [ d d l R u l e N a m e . s e l e c t e d I n d e x ] . v a l u e )   {  
                         c a s e   " 0 " :   t d S e t R u l e V a l u e . s t y l e . d i s p l a y   =   ' ' ;   l b l D o l l a r S i g n . i n n e r H T M L   =   ' $ ' ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 3 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 3 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 3 ] ) ,   f a l s e ) ;   }  
                                 i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 4 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 4 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 4 ] ) ,   f a l s e ) ;   }  
                                 b r e a k ;   c a s e   " 1 " :   t d S e t R u l e V a l u e . s t y l e . d i s p l a y   =   ' ' ;   l b l D o l l a r S i g n . i n n e r H T M L   =   ' $ ' ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 3 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 3 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 3 ] ) ,   f a l s e ) ;   }  
                                 i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 4 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 4 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 4 ] ) ,   f a l s e ) ;   }  
                                 b r e a k ;   c a s e   " 2 " :   t d N e e d s A p p r o v a l . s t y l e . d i s p l a y   =   ' ' ;   b r e a k ;   c a s e   " 3 " :   t d S e t S p e c i f i c B r a n d . s t y l e . d i s p l a y   =   ' ' ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 0 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 0 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 0 ] ) ,   f a l s e ) ;   }  
                                 b r e a k ;   c a s e   " 4 " :   t d S e t S p e c i f i c C a t e g o r y . s t y l e . d i s p l a y   =   ' ' ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 1 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 1 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 1 ] ) ,   f a l s e ) ;   }  
                                 b r e a k ;   c a s e   " 5 " :   t d S e t S p e c i f i c P r o d u c t . s t y l e . d i s p l a y   =   ' ' ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 2 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 2 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 2 ] ) ,   f a l s e ) ;   }  
                                 l b l D o l l a r S i g n . i n n e r H T M L   =   ' M F G   P a r t   # ' ;   b r e a k ;   c a s e   " 6 " :   t d S e t S p e c i f i c B r a n d . s t y l e . d i s p l a y   =   ' ' ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 0 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 0 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 0 ] ) ,   f a l s e ) ;   }  
                                 b r e a k ;   c a s e   " 7 " :   t d S e t S p e c i f i c C a t e g o r y . s t y l e . d i s p l a y   =   ' ' ;   i f   ( v a l i d a t o r I d L i s t   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 1 ] )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 1 ] )   ! =   u n d e f i n e d )  
                                 {   V a l i d a t o r E n a b l e ( d o c u m e n t . g e t E l e m e n t B y I d ( v a l i d a t o r I d L i s t [ 1 ] ) ,   f a l s e ) ;   }  
                                 b r e a k ;  
                 }    
         }    
 }  
 f u n c t i o n   C h e c k B o x C h e c k e d ( c h e c k b o x ,   t y p e ,   s e l e c t e d S t e p N o ,   h d n S e l e c t e d I d ,   h d n S e l e c t e d W o r k f l o w I D s )   {  
         v a r   h d n S e l e c t e d I d s   =   d o c u m e n t . g e t E l e m e n t B y I d ( h d n S e l e c t e d I d ) ;   v a r   h d n S e l e c t e d W o r k F l o w I D   =   d o c u m e n t . g e t E l e m e n t B y I d ( h d n S e l e c t e d W o r k f l o w I D s ) ;   i f   ( h d n S e l e c t e d I d s   ! =   n u l l )   {  
                 i f   ( c h e c k b o x . c h e c k e d   = =   t r u e )   {  
                         i f   ( t y p e   = =   ' r u l e '   & &   h d n S e l e c t e d I d s   ! =   n u l l )  
                         {   t o t a l R u l e s C h e c k e d + + ;   h d n S e l e c t e d I d s . v a l u e   =   ( t r i m ( h d n S e l e c t e d I d s . v a l u e )   = =   ' ' )   ?   s e l e c t e d S t e p N o   :   h d n S e l e c t e d I d s . v a l u e   +   ' , '   +   s e l e c t e d S t e p N o ;   }  
                         e l s e   i f   ( t y p e   = =   ' w o r k f l o w '   & &   h d n S e l e c t e d W o r k F l o w I D   ! =   n u l l )  
                         {   t o t a l W o r k F l o w s C h e c k e d + + ;   h d n S e l e c t e d W o r k F l o w I D . v a l u e   =   ( t r i m ( h d n S e l e c t e d W o r k F l o w I D . v a l u e )   = =   ' ' )   ?   s e l e c t e d S t e p N o   :   h d n S e l e c t e d W o r k F l o w I D . v a l u e   +   ' , '   +   s e l e c t e d S t e p N o ;   }    
                 }  
                 e l s e   {  
                         i f   ( t y p e   = =   ' r u l e '   & &   h d n S e l e c t e d I d s   ! =   n u l l )  
                         {   t o t a l R u l e s C h e c k e d - - ;   h d n S e l e c t e d I d s . v a l u e   =   h d n S e l e c t e d I d s . v a l u e . r e p l a c e ( s e l e c t e d S t e p N o ,   ' ' ) ;   }  
                         e l s e   i f   ( t y p e   = =   ' w o r k f l o w '   & &   h d n S e l e c t e d W o r k F l o w I D   ! =   n u l l )  
                         {   t o t a l W o r k F l o w s C h e c k e d - - ;   h d n S e l e c t e d W o r k F l o w I D . v a l u e   =   h d n S e l e c t e d W o r k F l o w I D . v a l u e . r e p l a c e ( s e l e c t e d S t e p N o ,   ' ' ) ;   }    
                 }    
         }    
 }  
 f u n c t i o n   V a l i d a t e C h e c k b o x e s ( t y p e )   {  
         i f   ( t y p e   = =   ' r u l e ' )   {  
                 i f   ( t o t a l R u l e s C h e c k e d   < =   0 )  
                 {   a l e r t ( " Y o u   m u s t   s e l e c t   a t   l e a s t   o n e   r u l e . " ) ;   r e t u r n   f a l s e ;   }    
         }  
         e l s e   i f   ( t y p e   = =   ' w o r k f l o w ' )   {  
                 i f   ( t o t a l W o r k F l o w s C h e c k e d   < =   0 )  
                 {   a l e r t ( " Y o u   m u s t   s e l e c t   a t   l e a s t   o n e   w o r k F o l w . " ) ;   r e t u r n   f a l s e ;   }  
                 i f   ( ! 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   t h e   s e l e c t e d   w o r k F l o w s   ? ' ) )  
                 {   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   C l o s e P o p u P ( p o p U p I D )   {  
         i f   ( $ f i n d ( p o p U p I D )   ! =   n u l l )  
         {   $ f i n d ( p o p U p I D ) . h i d 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   S a v e C h a n g e s ( o b j e c t )  
 {  
 	 / / a l e r t ( o b j e c t . a t t r i b u t e s [ " d i s a b l e d " ] . v a l u e ) ;  
 	 i f ( o b j e c t   ! =   n u l l   & &   o b j e c t . a t t r i b u t e s   ! =   n u l l   & &   o b j e c t . a t t r i b u t e s [ " d i s a b l e d " ]   ! =   n u l l   & &   o b j e c t . a t t r i b u t e s [ " d i s a b l e d " ] . v a l u e ! =   n u l l )  
 	 {  
 	 	 i f ( o b j e c t . a t t r i b u t e s [ " d i s a b l e d " ] . v a l u e . t o U p p e r C a s e ( )   = =   " t r u e " . t o U p p e r C a s e ( )   | |   o b j e c t . a t t r i b u t e s [ " d i s a b l e d " ] . v a l u e . t o U p p e r C a s e ( )   = =   " D I S A B L E D " )  
 	 	 {  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 }  
 	 }  
 / / 	 i f ( o b j e c t   ! =   n u l l )  
 / / 	 {  
 / / 	 	 a l e r t ( o b j e c t . d i s a b l e d ) ;  
 / / 	 }  
      
   r e t u r n   c o n f i r m ( ' U n s a v e d   c h a n g e s   w i l l   b e   l o s t . ' ) ;   }  
 f u n c t i o n   M a x L e n g t h C h e c k F o r F C K E d i t o r ( f c k C l i e n t I D ,   m a x L e n g t h A l l o w e d )   {  
         i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0 )   {  
                 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;   v a r   p l a i n T e x t ;   i f   ( o E d i t o r   ! =   n u l l )   {  
                         p l a i n T e x t   =   t r i m _ w h i t e _ s p a c e ( o E d i t o r . G e t H T M L ( ) ) ;   p l a i n T e x t   =   p l a i n T e x t . r e p l a c e ( / < \ / ? [ ^ > ] + ( > | $ ) / g ,   " " ) ;   i f   ( p l a i n T e x t . l e n g t h   >   m a x L e n g t h A l l o w e d )  
                         {   a l e r t ( ' P l e a s e   e n t e r   u p t o   '   +   m a x L e n g t h A l l o w e d   +   '   c h a r a c t e r s   f o r   D e s c r i p t i o n . ' ) ;   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   t r i m ( s )  
 {   v a r   t e m p   =   s ;   r e t u r n   t e m p . r e p l a c e ( / ^ \ s * | \ s * $ / g ,   ' ' ) ;   }  
 f u n c t i o n   S e t T e x t B o x T e x t ( t e x t b o x I D ,   t o B e R e p l a c e d V a l u e ,   r e p l a c e W i t h V a l u e )   {  
         v a r   t e x t 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 ( t e x t b o x I D ) ;   i f   ( t e x t b o x   ! =   n u l l )   {  
                 i f   ( t e x t b o x . v a l u e   = =   t o B e R e p l a c e d V a l u e )  
                 {   t e x t b o x . v a l u e   =   r e p l a c e W i t h V a l u e ;   }    
         }    
 }  
 f u n c t i o n   S e a r c h C o n t r o l K e y D o w n ( b u t t o n C l i e n t I d ,   a u t o C o m p l e t e E x t e n d e r I d ,   e v e n t )   {  
         v a r   b t n   =   d o c u m e n t . g e t E l e m e n t B y I d ( b u t t o n C l i e n t I d ) ;   v a r   a u t o E x t n d r   =   $ f i n d ( a u t o C o m p l e t e E x t e n d e r I d ) ;   v a r   i s E n t e r K e y P r e s s e d   =   f a l s e ;   i f   ( d o c u m e n t . a l l )   {  
                 i f   ( e v e n t . k e y C o d e   = =   1 3 )  
                 {   i s E n t e r K e y P r e s s e d   =   t r u e ;   }    
         }  
         e l s 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 )   {  
                 i f   ( e v e n t . w h i c h   = =   1 3 )  
                 {   i s E n t e r K e y P r e s s e d   =   t r u e ;   }    
         }  
         e l s e   i f   ( d o c u m e n t . l a y e r s )   {  
                 i f   ( e v e n t . w h i c h   = =   1 3 )  
                 {   i s E n t e r K e y P r e s s e d   =   t r u e ;   }    
         }  
         i f   ( i s E n t e r K e y P r e s s e d   = =   t r u e )   {  
                 i f   ( a u t o E x t n d r   ! =   n u l l )   {  
                         i f   ( a u t o E x t n d r . _ c o m p l e t i o n L i s t E l e m e n t . s t y l e . v i s i b i l i t y   = =   ' h i d d e n ' )  
                         {   e v e n t . r e t u r n V a l u e   =   f a l s e ;   e v e n t . c a n c e l   =   t r u e ;   b t n . c l i c k ( ) ;   }    
                 }    
         }    
 }  
 f u n c t i o n   d e l e t e P r o d u c t ( )   {  
         i f   ( c o n f i r m ( ' T h e   s e l e c t e d   p r o d u c t   w i l l   b e   d e l e t e d   p e r m a n e n t l y . ' ) )  
         {   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 e l e t e C o m p a r i s o n C h a r t ( )   {  
         i f   ( c o n f i r m ( ' T h e   s e l e c t e d   c o m p a r i s o n   c h a r t   w i l l   b e   d e l e t e d   p e r m a n e n t l y . ' ) )  
         {   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 e l e t e W e b L i n k ( )   {  
         i f   ( c o n f i r m ( ' T h e   s e l e c t e d   w e b   l i n k   w i l l   b e   d e l e t e d   p e r m a n e n t l y . ' ) )  
         {   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 e l e t e K e y w o r d ( )   {  
         i f   ( c o n f i r m ( ' T h e   s e l e c t e d   k e y w o r d   w i l l   b e   d e l e t e d   p e r m a n e n t l y . ' ) )  
         {   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   E d i t S e a r c h N a m e ( c o n t r o l I d s )   {  
         v a r   I D s   =   c o n t r o l I d s . s p l i t ( ' , ' ) ;   i f   ( I D s   ! =   u n d e f i n e d )  
         {   v a r   l n k S e a r c h   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 0 ] ) ;   v a r   l n k R e n a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 1 ] ) ;   v a r   l n k U p d a t e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 2 ] ) ;   v a r   l n k C a n c e l   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 3 ] ) ;   v a r   t x t S e a r c h N a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 4 ] ) ;   l n k S e a r c h . s t y l e . d i s p l a y   =   ' n o n e ' ;   l n k R e n a m e . s t y l e . d i s p l a y   =   ' n o n e ' ;   l n k U p d a t e . s t y l e . d i s p l a y   =   ' b l o c k ' ;   l n k C a n c e l . s t y l e . d i s p l a y   =   ' ' ;   t x t S e a r c h N a m e . s t y l e . d i s p l a y   =   ' ' ;   r e t u r n   f a l s e ;   }    
 }  
 f u n c t i o n   C a n c e l E d i t S e a r c h N a m e ( c o n t r o l I d s )   {  
         v a r   I D s   =   c o n t r o l I d s . s p l i t ( ' , ' ) ;   i f   ( I D s   ! =   u n d e f i n e d )  
         {   v a r   l n k S e a r c h   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 0 ] ) ;   v a r   l n k R e n a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 1 ] ) ;   v a r   l n k U p d a t e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 2 ] ) ;   v a r   l n k C a n c e l   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 3 ] ) ;   v a r   t x t S e a r c h N a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 4 ] ) ;   l n k S e a r c h . s t y l e . d i s p l a y   =   ' ' ;   l n k R e n a m e . s t y l e . d i s p l a y   =   ' ' ;   l n k U p d a t e . s t y l e . d i s p l a y   =   ' n o n e ' ;   l n k C a n c e l . s t y l e . d i s p l a y   =   ' n o n e ' ;   t x t S e a r c h N a m e . s t y l e . d i s p l a y   =   ' n o n e ' ;   r e t u r n   f a l s e ;   }    
 }  
 f u n c t i o n   U p d a t e S e a r c h N a m e ( c o n t r o l I d s ,   i s U s e r L o g g e d I n )   {  
         v a r   I D s   =   c o n t r o l I d s . s p l i t ( ' , ' ) ;   i f   ( I D s   ! =   u n d e f i n e d )   {  
                 v a r   l n k S e a r c h   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 0 ] ) ;   v a r   l n k R e n a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 1 ] ) ;   v a r   l n k U p d a t e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 2 ] ) ;   v a r   l n k C a n c e l   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 3 ] ) ;   v a r   t x t S e a r c h N a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( I D s [ 4 ] ) ;   v a r   t x t S e a r c h 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 s [ 5 ] ) ;   i f   ( t x t S e a r c h I d   ! =   n u l l )   {  
                         i f   ( t r i m ( t x t S e a r c h N a m e . v a l u e )   = =   ' ' )  
                         {   a l e r t ( ' P l e a s e   e n t e r   " R e c e n t   S e a r c h   N a m e " . ' ) ;   r e t u r n   f a l s e ;   }  
                         v a r   a l p h a n u m e r i c R e g x   =   / [ ^ 0 - 9 a - z A - Z   ] / ;   i f   ( a l p h a n u m e r i c R e g x . t e s t ( t x t S e a r c h N a m e . v a l u e ) )  
                         {   a l e r t ( ' O n l y   a l p h a - n u m e r i c   c h a r a c t e r s   a r e   a l l o w e d . ' ) ;   r e t u r n   f a l s e ;   }    
                 }  
                 v a r   v a l u e s   =   t x t S e a r c h I d . v a l u e   +   ' | | | '   +   t x t S e a r c h N a m e . v a l u e   +   ' | | | '   +   i s U s e r L o g g e d I n ;   i f   ( U p d a t e S e a r c h N a m e A j a x C a l l ( v a l u e s )   = =   " 1 " )   {  
                         l n k S e a r c h . s t y l e . d i s p l a y   =   ' ' ;   i f   ( t x t S e a r c h N a m e . v a l u e . t r i m ( ) . l e n g t h   >   1 1 )  
                                 l n k S e a r c h . i n n e r H T M L   =   ( t x t S e a r c h N a m e . v a l u e . t r i m ( ) ) . s u b s t r i n g ( 0 ,   7 )   +   ' . . . ' ;   e l s e  
                                 l n k S e a r c h . i n n e r H T M L   =   t x t S e a r c h N a m e . v a l u e . t r i m ( ) ;   l n k S e a r c h . t i t l e   =   t x t S e a r c h N a m e . v a l u e . t r i m ( ) ;   l n k R e n a m e . s t y l e . d i s p l a y   =   ' ' ;   l n k U p d a t e . s t y l e . d i s p l a y   =   ' n o n e ' ;   l n k C a n c e l . s t y l e . d i s p l a y   =   ' n o n e ' ;   t x t S e a r c h N a m e . s t y l e . d i s p l a y   =   ' n o n e ' ;  
                 }    
         }  
         r e t u r n   f a l s e ;  
 }  
 f u n c t i o n   U p d a t e S e a r c h N a m e A j a x C a l l ( s t r V a l u e )  
 {   v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " U p d a t e S e a r c h N a m e M e t h o d = "   +   s t r V a l u e ;   v a r   r e s u l t   =   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;   r e t u r n   1 ;   }  
 f u n c t i o n   C h e c k V a l i d a t i o n F o r M u l t i p l e T e x t b o x ( t x t b o x I d s ,   I D S e p e r a t e r s ,   f o r b i d d e n C h a r a c t e r s )   {  
         i f   ( t x t b o x I d s   ! =   n u l l   & &   t x t b o x I d s   ! =   u n d e f i n e d   & &   I D S e p e r a t e r s   ! =   n u l l   & &   I D S e p e r a t e r s   ! =   u n d e f i n e d   & &   f o r b i d d e n C h a r a c t e r s   ! =   n u l l   & &   f o r b i d d e n C h a r a c t e r s   ! =   u n d e f i n e d )   {  
                 v a r   t x t I d s   =   t x t b o x I d s . s p l i t ( I D S e p e r a t e r s ) ;   i f   ( t x t I d s   ! =   n u l l   & &   t x t I d s . l e n g t h   >   0 )   {  
                         f o r   ( v a r   i n d e x   =   0 ;   i n d e x   <   t x t I d s . l e n g t h ;   i n d e x + + )   {  
                                 i f   ( v a l i d a t e T e x t ( t x t I d s [ i n d e x ] ,   f o r b i d d e n C h a r a c t e r s )   = =   f a 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   v a l i d a t e T e x t ( t x t b o x I D ,   f o r b i d d e n C h a r a c t e r s )   {  
         i f   ( t x t b o x I D   ! =   n u l l   & &   t x t b o x I D   ! =   u n d e f i n e d   & &   f o r b i d d e n C h a r a c t e r s   ! =   n u l l   & &   f o r b i d d e n C h a r a c t e r s   ! =   u n d e f i n e d )   {  
                 v a r   t x t 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 ( t x t b o x I D ) ;   i f   ( t x t B o x   ! =   n u l l   & &   f o r b i d d e n C h a r a c t e r s   ! =   n u l l   & &   f o r b i d d e n C h a r a c t e r s . l e n g t h   >   0 )   {  
                         i f   ( t x t B o x . i d   ! =   n u l l   & &   t x t B o x . i d . i n d e x O f ( ' f c k ' )   >   - 1 )  
                         {   r e t u r n   t r u e ;   }  
                         i f   ( t x t B o x . v a l u e . m a t c h ( R e g E x p ( f o r b i d d e n C h a r a c t e r s ) ) )  
                         {   a l e r t ( ' S p e c i a l   c h a r a c t e r   i s   n o t   a l l o w e d . ' ) ;   t x t B o x . f o c u s ( ) ;   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   D i s a b l e B u t t o n s ( b u t t o n C l i e n t I D s ,   I D S e p e r a t o r s ,   i s D i s a b l e d ,   p o p u p )   {  
         i f   ( b u t t o n C l i e n t I D s   ! =   n u l l   & &   b u t t o n C l i e n t I D s   ! =   u n d e f i n e d   & &   I D S e p e r a t o r s   ! =   n u l l   & &   I D S e p e r a t o r s   ! =   u n d e f i n e d   & &   i s D i s a b l e d   ! =   n u l l   & &   i s D i s a b l e d   ! =   u n d e f i n e d )   {  
                 v a r   b u t t o n I d s   =   b u t t o n C l i e n t I D s . s p l i t ( I D S e p e r a t o r s ) ;   i f   ( b u t t o n I d s   ! =   n u l l   & &   b u t t o n I d s . l e n g t h   >   0 )   {  
                         f o r   ( v a r   i n d e x   =   0 ;   i n d e x   <   b u t t o n I d s . l e n g t h ;   i n d e x + + )   {  
                                 v a r   b u t t o n   =   d o c u m e n t . g e t E l e m e n t B y I d ( b u t t o n I d s [ i n d e x ] ) ;   i f   ( b u t t o n   ! =   n u l l )  
                                 {   b u t t o n . d i s a b l e d   =   i s D i s a b l e d ;   }    
                         }    
                 }    
         }  
         i f   ( p o p u p   ! =   u n d e f i n e d   & &   p o p u p   ! =   n u l l )  
         {   $ f i n d ( p o p u p ) . h i d e ( ) ;   }    
 }  
 f u n c t i o n   v a l i d a t e T e x t B o x ( t x t B o x ,   l a b l e T e x t ,   i s R e q u i r e d ,   t y p e )   {  
         v a r   a l p h a n u m e r i c R e g x   =   / [ ^ 0 - 9 a - z A - Z   ] / ;   v a r   i s V a l i d a t e d   =   t r u e ;   i f   ( t x t B o x   ! =   n u l l   & &   t x t B o x   ! =   u n d e f i n e d )   {  
                 i f   ( i s R e q u i r e d )   {  
                         i f   ( t r i m ( t x t B o x . v a l u e )   = =   ' ' )   {  
                                 a l e r t ( ' P l e a s e   e n t e r   t h e   " '   +   l a b l e T e x t   +   ' " . ' ) ;   i s V a l i d a t e d   =   f a l s e ;   i f   ( t x t B o x . s t y l e . d i s p l a y   ! =   ' n o n e '   & &   t x t B o x . d i s a b l e d   = =   f a l s e )  
                                         t x t B o x . f o c u s ( ) ;  
                         }    
                 }  
                 s w i t c h   ( t y p e )   {  
                         c a s e   0 :   i f   ( i s V a l i d a t e d   & &   a l p h a n u m e r i c R e g x . t e s t ( t x t B o x . v a l u e ) )  
                                 {   a l e r t ( ' O n l y   a l p h a - n u m e r i c   c h a r a c t e r s   a r e   a l l o w e d . ' ) ;   t x t B o x . f o c u s ( ) ;   }  
                                 b r e a k ;   c a s e   1 :   v a r   u r l R e g u l a r e x p e s s i o n   =   / [ a - z A - Z 0 - 9 \ - \ . ] + \ . [ a - z A - Z ] { 2 , 3 } ( : [ a - z A - Z 0 - 9 ] * ) ? \ / ? ( [ a - z A - Z 0 - 9 \ - \ . _ \ ? \ , \ ' \ / \ \ \ + & % \ $ # \ = ~ ] ) * / ;   i f   ( i s V a l i d a t e d   & &   ( ! u r l R e g u l a r e x p e s s i o n . t e s t ( t x t B o x . v a l u e ) ) )  
                                 {   a l e r t ( ' I n v a l i d   " '   +   l a b l e T e x t   +   ' "   f o r m a t   ( w w w . d o m a i n n a m e . c o m ) ' ) ;   t x t B o x . f o c u s ( ) ;   }  
                                 b r e a k ;   c a s e   3 :   v a r   n u m r i c R e g   =   / [ ^ 0 - 9   ] / ;   i f   ( i s V a l i d a t e d   & &   n u m r i c R e g . t e s t ( t x t B o x . v a l u e ) )  
                                 {   a l e r t ( ' O n l y   p o s i t i v e   i n t e g e r   v a l u e s ( g r e a t e r   t h a n   z e r o )   a r e   a l l o w e d . ' ) ;   i s V a l i d a t e d   =   f a l s e ;   t x t B o x . f o c u s ( ) ;   }  
                                 i f   ( i s V a l i d a t e d   & &   t x t B o x . v a l u e   < =   0 )  
                                 {   a l e r t ( ' O n l y   p o s i t i v e   i n t e g e r   v a l u e s ( g r e a t e r   t h a n   z e r o )   a r e   a l l o w e d . ' ) ;   t x t B o x . f o c u s ( ) ;   }  
                                 b r e a k ;  
                 }    
         }    
 }  
 f u n c t i o n   D e l e t e O b j e c t ( o b j e c t T y p e )   {  
         v a r   d i s p l a y T e x t   =   " A r e   Y o u   s u r e   t o   d e l e t e   ? " ;   i f   ( o b j e c t T y p e   ! =   n u l l )  
                 d i s p l a y T e x t   =   " A r e   Y o u   s u r e   t o   d e l e t e   t h e   "   +   o b j e c t T y p e   +   "   ? " ;   i f   ( c o n f i r m ( d i s p l a y T e x t )   = =   t r u 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   f n T r a p K D ( b t n 1 ,   e v e n t )   {  
         v a r   b t n   =   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 1 ) ;   i f   ( d o c u m e n t . a l l )   {  
                 i f   ( e v e n t . k e y C o d e   = =   1 3 )  
                 {   e v e n t . r e t u r n V a l u e   =   f a l s e ;   e v e n t . c a n c e l   =   t r u e ;   b t n . c l i c k ( ) ;   }    
         }  
         e l s 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 )   {  
                 i f   ( e v e n t . w h i c h   = =   1 3 )  
                 {   e v e n t . r e t u r n V a l u e   =   f a l s e ;   e v e n t . c a n c e l   =   t r u e ;   b t n . c l i c k ( ) ;   }    
         }  
         e l s e   i f   ( d o c u m e n t . l a y e r s )   {  
                 i f   ( e v e n t . w h i c h   = =   1 3 )  
                 {   e v e n t . r e t u r n V a l u e   =   f a l s e ;   e v e n t . c a n c e l   =   t r u e ;   b t n . c l i c k ( ) ;   }    
         }    
 }  
 f u n c t i o n   R e d i r e c t T o U r l ( u r l )   {  
         i f   ( u r l   ! =   ' ' )  
         {   w i n d o w . l o c a t i o n . h r e f   =   u r l ;   }    
 }  
 f u n c t i o n   G e t T r i m T e x t ( t e x t T o T r i m ,   t r i m L e n g t h )   {  
         i f   ( t e x t T o T r i m   ! =   n u l l )   {  
                 i f   ( t e x t T o T r i m . l e n g t h   >   t r i m L e n g t h )  
                 {   t e x t T o T r i m   =   t e x t T o T r i m . s u b s t r i n g ( 0 ,   ( t r i m L e n g t h   -   4 ) )   +   " . . . " ;   }    
         }  
         r e t u r n   t e x t T o T r i m ;  
 }  
 f u n c t i o n   E n c o d e U R L ( q u e r y S t r i n g )  
 {   r e t u r n   e s c a p e ( q u e r y S t r i n g ) ;   }  
 f u n c t i o n   c l e a r D a t a ( c o n t r o l ,   d e f a u l t T e x t )   {  
         i f   ( c o n t r o l . v a l u e   = =   d e f a u l t T e x t )  
                 c o n t r o l . v a l u e   =   ' ' ;  
 }  
 f u n c t i o n   s h o w D a t a ( c o n t r o l ,   d e f a u l t T e x t )   {  
         i f   ( c o n t r o l . v a l u e   = =   ' ' )  
                 c o n t r o l . v a l u e   =   d e f a u l t T e x t ;  
 }  
 f u n c t i o n   c h e c k T e x t A r e a M a x L e n g t h ( t e x t B o x ,   e ,   l e n g t h )  
 {   }  
 f u n c t i o n   o n d d l B r a n d s T i t l e C h a n g e ( d d l B r a n d s )   {  
         i f   ( d d l B r a n d s   ! =   n u l l )  
         {   l o c a t i o n . h r e f   =   ' . . / . . / U I / B r a n d s / B r a n d S h o w C a s e . a s p x ? m a n u f a c t u r e r I d = '   +   d d l B r a n d s . v a l u e ;   }    
 }  
 f u n c t i o n   o n N e w A d d r e s s C h e c k C h a n g e d ( r d r N e w A d d r e s s I D ,   c h k S a v e A d d r e s s I D )   {  
         v a r   c h k S a v e A d d r e s s   =   d o c u m e n t . g e t E l e m e n t B y I d ( c h k S a v e A d d r e s s I D ) ;  
           v a r   r d r N e w A d d r e s s   =   d o c u m e n t . g e t E l e m e n t B y I d ( r d r N e w A d d r e s s I D ) ;    
         i f   ( r d r N e w A d d r e s s   ! =   n u l l   & &   c h k S a v e A d d r e s s   ! =   n u l l )  
         {   c h k S a v e A d d r e s s . c h e c k e d   =   r d r N e w A d d r e s s . c h e c k e d ;   }    
 }  
 f u n c t i o n   G e t P r o d u c t I D ( p a r t N u m b e r T y p e ,   t x t B o x I D ,   h d n F i e l d I D ,   t x t B r a n d I D ,   h d n B r a n d I D ,   t x t C a t e g o r y I D ,   h d n C a t e g o r y I D )   {  
         v a r   r e s u l t   =   " " ;   v a r   p r o d u c t I D   =   " - 1 " ;   v a r   t x t 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 ( t x t B o x I D ) ;   v a r   h d n F i e l d   =   d o c u m e n t . g e t E l e m e n t B y I d ( h d n F i e l d I D ) ;   v a r   t x t B r a n d   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t B r a n d I D ) ;   v a r   h d n B r a n d   =   d o c u m e n t . g e t E l e m e n t B y I d ( h d n B r a n d I D ) ;   v a r   t x t C a t e g o r y   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t C a t e g o r y I D ) ;   v a r   h d n C a t e g o r y   =   d o c u m e n t . g e t E l e m e n t B y I d ( h d n C a t e g o r y I D ) ;   v a r   v a l u e s   =   n u l l ;   i f   ( t x t B o x   ! =   n u l l   & &   h d n F i e l d   ! =   n u l l )   {  
         i f   ( t r i m ( t x t B o x . v a l u e )   = =   ' ' )   {  
                 r e t u r n   f a l s e ;  
         }  
                 i f   ( t r i m ( t x t B o x . v a l u e )   ! =   ' '   & &   t r i m ( t x t B o x . v a l u e ) . t o L o w e r C a s e ( )   ! =   ' a u t o ' )   {  
                         v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " F i n d P r o d u c t I D B y M F G P a r t N u m b e r = "   +   p a r t N u m b e r T y p e   +   " , "   +   t r i m ( t x t B o x . v a l u e ) ;   r e s u l t   =   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;   v a l u e s   =   r e s u l t . s p l i t ( ' = = = = ' ) ;   i f   ( v a l u e s   ! =   n u l l   & &   v a l u e s . l e n g t h   > =   5 )   {  
                                 p r o d u c t I D   =   v a l u e s [ 4 ] ;   i f   ( h d n B r a n d   ! =   n u l l )  
                                 {   h d n B r a n d . v a l u e   =   v a l u e s [ 0 ] ;   }  
                                 i f   ( t x t B r a n d   ! =   n u l l )  
                                 {   t x t B r a n d . v a l u e   =   v a l u e s [ 1 ] ;   }   i f   ( h d n C a t e g o r y   ! =   n u l l )  
                                 {   h d n C a t e g o r y . v a l u e   =   v a l u e s [ 2 ] ;   }   i f   ( t x t C a t e g o r y   ! =   n u l l )  
                                 {   t x t C a t e g o r y . v a l u e   =   v a l u e s [ 3 ] ;   }    
                         }    
                 }  
                 h d n F i e l d . v a l u e   =   p r o d u c t I D ;   i f   ( p r o d u c t I D   = =   " - 1 " )  
                 {   a l e r t ( " I n v a l i d   P r o d u c t   N u m b e r   "   +   t x t B o x . v a l u e   +   " . " ) ;   }    
         }  
 }  
 f u n c t i o n   O n P o p U p S h o w ( )  
 {  
         i f   ( d o c u m e n t . a l l )   {   d o c u m e n t . b o d y . s c r o l l   =   " n o " ;   }  
         e l s e   {   v a r   o T o p   =   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p ;   d o c u m e n t . b o d y . s t y l e . o v e r f l o w   =   " h i d d e n " ;   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p   =   o T o p ;   }    
 }  
 f u n c t i o n   O n P o p U p C l o s e ( )  
 {   d o c u m e n t . b o d y . s c r o l l   =   " " ;   d o c u m e n t . b o d y . s t y l e . o v e r f l o w   =   " " ;   }  
 v a r   i s f i r e F o x B r o w s e r   =   0 ;   i f   ( d o c u m e n t . a l l )   {   i s f i r e F o x B r o w s e r   =   0 ;   }   e l s e   {   i s f i r e F o x B r o w s e r   =   1 ;   }  
  
 f u n c t i o n   P r e v i e w M B B o x f o r T y p e 1 F o r P r o d u c t B o x ( f c k C l i e n t I D ,   t d P r e v i e w I D ,   t x t T i t l e C l i e n t I D ,   l b l P r e v i e w T i t l e C l i e n t I D ,   m p e P r e v i e w C l i e n t I D ,   b u t t o n I D T o B e D i s a b l e d ,    
                                                                                       s e p e r a t o r F o r I D s ,   i s t o B e D i s a b l e d , h t m l T e x t A r e a I D , t r H T M L B o x P r e v i e w C l i e n t I D , t r P r o d u c t B o x P r e v i e w C l i e n t I D ,   r d o H T M L B o x I D ,  
                                                                                       r d o P r o d u c t B o x I D , s r c H i d B r a n d I D ,   s r c H i d C a t e g o r y I D ,   s r c H i d P r o d u c t I D ,   s r c T i t l e ,   s r c S u b T i t l e ,   s r c S h o w P r i c e ,   s r c P r o d P r i c e ,    
                                                                                       s r c P r o d I m a g e U r l ,   s r c M a i n F e a t u r e s ,   s r c R b t n A ,   s r c R b t n B ,   s r c S e l C r i t e r i a B r a n d ,   s r c S e l C r i t e r i a C a t e g o r y ,   s r c S e l C r i t e r i a P r o d u c t ,  
                                                                                       t g t T i t l e A ,   t g t S u b T i t l e A ,   t g t P r o d I m a g e A ,   t g t P r i c e D i v A ,   t g t P r o d P r i c e A ,   t g t P r o d M a i n F e a t u r e s A ,   t g t D i v A ,   t g t T i t l e B ,    
                                                                                       t g t S u b T i t l e B ,   t g t P r o d I m a g e B ,   t g t P r i c e D i v B ,   t g t P r o d P r i c e B ,   t g t P r o d M a i n F e a t u r e s B ,   t g t D i v B ,   h d n F o r m a t ,   p o p U p ,   b u t t o n I D s ,  
                                                                                       m p e P r e v i e w I D ,   r d b F i l t e r N o n e C l i e n t I D ,   r d b F i l t e r F e a t u r e d C l i e n t I D ,   l b l A P r i c e P r e f i x P r e v i e w C l i e n t I D ,   l b l B P r i c e P r e f i x P r e v i e w C l i e n t I D ,  
                                                                                       t e x t F o r P r i c e T o B e s h o w n I n C a r t , h o v e r T e x t F o r P r i c e T o B e s h o w n I n C a r t , h i d d e n P r o d u c t L i n k )   {  
 	 v a r   o b j R d o H T M L 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 ( r d o H T M L B o x I D ) ;  
 	 v a r   o b j R d o P r o d u c t 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 ( r d o P r o d u c t B o x I D ) ;  
 	 v a r   t r H T M L B o x P r e v i e w =   d o c u m e n t . g e t E l e m e n t B y I d ( t r H T M L B o x P r e v i e w C l i e n t I D ) ;  
 	 v a r   t r P r o d u c t B o x P r e v i e w =   d o c u m e n t . g e t E l e m e n t B y I d ( t r P r o d u c t B o x P r e v i e w C l i e n t I D ) ;  
 	 v a r   m p e P r e v i e w   =   $ f i n d ( m p e P r e v i e w C l i e n t I D ) ;  
 	  
 	 i f ( o b j R d o H T M L B o x   ! =   n u l l   & &   o b j R d o P r o d u c t B o x   ! =   n u l l   & &   t r H T M L B o x P r e v i e w   ! =   n u l l   & &   t r P r o d u c t B o x P r e v i e w   ! =   n u l l )  
 	 {  
 	 	 t r H T M L B o x P r e v i e w . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 t r P r o d u c t B o x P r e v i e w . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 i f ( o b j R d o H T M L B o x . c h e c k e d )  
 	 	 {  
 	 	 	 t r H T M L B o x P r e v i e w . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	 i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0   & &   t d P r e v i e w I D   ! =   n u l l )   {  
 	 	 	 	 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
 	 	 	 	 v a r   H T M L T e x t   =   ' ' ;  
 	 	 	 	 v a r   t i t l e   =   ' ' ;  
 	 	 	 	 v a r   t d P r e v i e w   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d P r e v i e w I D ) ;  
 	 	 	 	 v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e C l i e n t I D ) ;  
 	 	 	 	 v a r   l b l P r e v i e w T i t l e   =   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 P r e v i e w T i t l e C l i e n t I D ) ;  
 	 	                  
 	 	 	 	 i f   ( m p e P r e v i e w   ! =   n u l l )   {  
 	 	 	 	 	 m p e P r e v i e w . h i d e ( ) ;  
 	 	 	 	 }  
 	 	 	 	 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l P r e v i e w T i t l e   ! =   n u l l )   {  
 	 	 	 	 	 t i t l e   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 i f   ( t i t l e   = =   ' ' )   {  
 	 	 	 	 	 	 a l e r t ( ' T i t l e   i s   r e q u i r e d . ' ) ;  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 i f   ( o E d i t o r   ! =   n u l l   & &   t d P r e v i e w   ! =   n u l l )   {  
 	 	 	 	 	 H T M L T e x t   =   o E d i t o r . G e t H T M L ( ) ;  
 	 	 	 	 	 i f   ( H T M L T e x t   = =   u n d e f i n e d   | |   H T M L T e x t   = =   n u l l   | |   t r i m ( H T M L T e x t )   = =   ' ' )   {  
 	 	 	 	 	 	 a l e r t ( ' D e s c r i p t i o n   i s   r e q u i r e d . ' ) ;  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 }  
 	 	                  
 	 	 	 	 }  
 	 	                  
 	 	 / /                   v a r   t a r e a = d o c u m e n t . g e t E l e m e n t B y I d ( h t m l T e x t A r e a I D ) ;  
 	 	 / /                 i f ( t a r e a   ! =   n u l l )  
 	 	 / /                 {  
 	 	 / /                         t a r e a . i n n e r H T M L   =   ' < t e x t a r e a   i d = " i n n e r C o n v e r t e r P r e v i e w "   s t y l e = " o v e r f l o w : v i s i b l e " > '   +   H T M L T e x t   +   ' < / t e x t a r e a > ' ;    
 	 	 / /                         H T M L T e x t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " i n n e r C o n v e r t e r P r e v i e w " ) . v a l u e ;  
 	 	 / /                         t a r e a . i n n e r H T M L     =   ' ' ;  
 	 	 / /                 }  
 	 	                  
 	 	 	 	 D i s a b l e B u t t o n s ( b u t t o n I D T o B e D i s a b l e d ,   s e p e r a t o r F o r I D s ,   i s t o B e D i s a b l e d ,   m p e P r e v i e w C l i e n t I D ) ;  
 	 	 	 	   t r y  
 	 	 	 	 	 {  
 	 	 	 	 	 	 / / t d P r e v i e w . i n n e r H T M L   =     ' < a s p : L i t e r a l   I D = " l i t H T M L P r e v i e w C o n t e n t 1 2 "   r u n a t = " s e r v e r " > '   +   H T M L T e x t + ' < / a s p : L i t e r a l > '   ;  
 	 	 	 	 	 	 t d P r e v i e w . i n n e r H T M L   =         H T M L T e x t   ;  
 	 	 	 	 	 }  
 	 	 	 	 	   c a t c h   ( e r r ) { }  
 	 	 	 	 / / t d P r e v i e w . i n n e r H T M L   =     H T M L T e x t ;  
 	 	 	 	 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l P r e v i e w T i t l e   ! =   n u l l )   {  
 	 	 	 	 	 i f   ( i s f i r e F o x B r o w s e r )   {  
 	 	 	 	 	 	 l b l P r e v i e w T i t l e . t e x t C o n t e n t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 l b l P r e v i e w T i t l e . i n n e r T e x t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 }  
 	 	                          
 	 	 	 	 }  
 	 	 	 	 i f   ( m p e P r e v i e w   ! =   n u l l )   {  
 	 	 	 	 	 m p e P r e v i e w . s h o w ( ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 t r P r o d u c t B o x P r e v i e w . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	 V e n d o r P a g e P r o d u c t B o x P r e v i e w ( h i d d e n P r o d u c t L i n k , s r c H i d B r a n d I D ,   s r c H i d C a t e g o r y I D ,   s r c H i d P r o d u c t I D ,   s r c T i t l e ,   s r c S u b T i t l e ,   s r c S h o w P r i c e ,   s r c P r o d P r i c e ,   s r c P r o d I m a g e U r l ,    
 	 	 	                                                         s r c M a i n F e a t u r e s ,   s r c R b t n A ,   s r c R b t n B ,   s r c S e l C r i t e r i a B r a n d ,   s r c S e l C r i t e r i a C a t e g o r y ,   s r c S e l C r i t e r i a P r o d u c t ,   t g t T i t l e A ,  
 	 	 	                                                         t g t S u b T i t l e A ,   t g t P r o d I m a g e A ,   t g t P r i c e D i v A ,   t g t P r o d P r i c e A ,   t g t P r o d M a i n F e a t u r e s A ,   t g t D i v A ,   t g t T i t l e B ,   t g t S u b T i t l e B ,  
 	 	 	                                                         t g t P r o d I m a g e B ,   t g t P r i c e D i v B ,   t g t P r o d P r i c e B ,   t g t P r o d M a i n F e a t u r e s B ,   t g t D i v B ,   h d n F o r m a t ,   p o p U p ,   b u t t o n I D s ,   m p e P r e v i e w I D ,    
 	 	 	                                                         r d b F i l t e r N o n e C l i e n t I D ,   r d b F i l t e r F e a t u r e d C l i e n t I D ,   l b l A P r i c e P r e f i x P r e v i e w C l i e n t I D ,   l b l B P r i c e P r e f i x P r e v i e w C l i e n t I D ,  
 	 	 	                                                         t e x t F o r P r i c e T o B e s h o w n I n C a r t , h o v e r T e x t F o r P r i c e T o B e s h o w n I n C a r t ) ;  
 	 	 }  
         }  
         r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   S a v e M B B o x f o r F o c u s P a g e F o r P r o d u c t B o x ( v e n d o r N a m e ,   C o n t r o l I d ,   f c k C l i e n t I D ,   t d I D ,   m p e I D ,   t x t T i t l e C l i e n t I D ,   l b l T i t l e C l i e n t I D , h t m l T e x t A r e a I D , r a d i o H t m l B o x I d ,  
                                                                                         r a d i o P r o d u c t B o x I d , t r H t m l B o x B o x I d , t r P r o d u c t B o x I d , p a g e I d ,   c o n t r o l I d ,   e n t i t y I d ,   I s C o n t e x t P a g e ,   P a g e C o n t e x t I D ,   A g e n c y I d ,    
                                                                                         I s A g e n c y G r o u p , s r c M e r c h a n d i z e B o x I d ,   s r c T i t l e ,   s r c S u b T i t l e ,   s r c C r i t e r i a B r a n d ,   s r c B r a n d I d ,   s r c B r a n d N a m e ,   s r c C r i t e r i a C a t e g o r y ,  
                                                                                         s r c C a t e g o r y I d ,   s r c C a t e g o r y N a m e ,   s r c C r i t e r i a P r o d u c t ,   s r c P r o d u c t I d ,   s r c P r o d u c t N a m e ,   s r c F r e q u e n c y ,   s r c S h o w P r i c e ,   s r c P r o d L i n k ,    
                                                                                         s r c F i l t e r s ,   s r c R b t n A ,   s r c R b t n B ,   p o p u p ,   s r c P r o d P r i c e ,   s r c P r o d I m a g e U r l ,   s r c P r o d M a i n F e a t u r e s ,   t g t T i t l e A ,   t g t S u b T i t l e A ,   t g t P r o d I m a g e A ,  
                                                                                         t g t P r i c e D i v A ,   t g t P r o d P r i c e A ,   t g t P r o d M a i n F e a t u r e s A ,   t g t D i v A ,   t g t T i t l e B ,   t g t S u b T i t l e B ,   t g t P r o d I m a g e B ,   t g t P r i c e D i v B ,   t g t P r o d P r i c e B ,    
                                                                                         t g t P r o d M a i n F e a t u r e s B ,   t g t D i v B ,   h d n F o r m a t ,   h d n H i d d e n F i e l d s ,   d d l B r a n d S e l e c t e d ,   d d l C a t e g o r y S e l e c t e d ,   d d l P r o d u c t S e l e c t e d ,   d d l B r a n d ,  
                                                                                         d d l C a t e g o r y ,   d d l P r o d u c t ,   i n v a l i d P a r t N u m b e r C h a n g e d ,   f o r b i d d e n C h a r a c t e r s ,   r d b F i l t e r N o n e C l i e n t I D ,   r d b F i l t e r F e a t u r e d C l i e n t I D ,  
                                                                                         h i d d e n P r o d u c t L i n k , h i d d e n I s H t m l C l i e n t I D , h i d d e n C o n f i g u r e H t m l T i t l e I D , h i d d e n C o n f i g u r e H t m l D e s c I D )  
 {  
       v a r   m y M P E = $ f i n d ( m p e I D ) ;  
       v a r   r a d i o H t m l 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 ( r a d i o H t m l B o x I d ) ;  
       v a r   r a d i o P r o d u c t B o x I d   =   d o c u m e n t . g e t E l e m e n t B y I d ( r a d i o P r o d u c t B o x I d ) ;  
       v a r   t r H t m l B o x 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 ( t r H t m l B o x B o x I d ) ;  
       v a r   t r P r o d u c t 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 ( t r P r o d u c t B o x I d ) ;  
       v a r   i s H T M L B o x   =   t r u e ;  
       v a r   h i d d e n C o n f i g u r e H t m l T i t l e = d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n C o n f i g u r e H t m l T i t l e I D ) ;  
       v a r   h i d d e n C o n f i g u r e H t m l D e s c = d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n C o n f i g u r e H t m l D e s c I D ) ;  
        
       i f ( r a d i o H t m l B o x   ! =   n u l l   & &   r a d i o P r o d u c t B o x I d   ! =   n u l l )  
       {  
 	 	 t r H t m l B o x B o x . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 t r P r o d u c t B o x . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 i s H T M L B o x   =   t r u e ;  
 	       i f ( r a d i o H t m l B o x . c h e c k e d )  
 	       {  
 	 	      
 	 	 	 t r H t m l B o x B o x . s t y l e . d i s p l a y = ' ' ;  
 	 	 	 i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0   & &   t d I D   ! =   n u l l )   {  
 	 	 	 	 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
 	 	 	 	 v a r   H T M L T e x t   =   ' ' ;  
 	 	 	 	 v a r   t i t l e   =   ' ' ;  
 	 	 	 	 v a r   t d   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d I D ) ;  
 	 	 	 	 v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e C l i e n t I D ) ;  
 	 	 	 	 v a r   l b l T i t l e   =   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 T i t l e C l i e n t I D ) ;  
 	 	                  
 	 	 	 	 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l T i t l e   ! =   n u l l )   {  
 	 	 	 	 	 t i t l e   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 i f   ( t i t l e   = =   ' ' )   {  
 	 	 	 	 	 	 a l e r t ( ' T i t l e   i s   r e q u i r e d . ' ) ;  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 i f   ( o E d i t o r   ! =   n u l l   & &   t d   ! =   n u l l )   {  
 	 	 	 	 	 H T M L T e x t   =   o E d i t o r . G e t H T M L ( ) ;  
 	 	 	 	 	 i f   ( H T M L T e x t   = =   u n d e f i n e d   | |   H T M L T e x t   = =   n u l l   | |   t r i m ( H T M L T e x t )   = =   ' ' )   {  
 	 	 	 	 	 	 a l e r t ( ' D e s c r i p t i o n   i s   r e q u i r e d . ' ) ;  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	                  
 / / 	 	                
 	 	 / /                 v a r   t a r e a = d o c u m e n t . g e t E l e m e n t B y I d ( h t m l T e x t A r e a I D ) ;  
 	 	 / /                 i f ( t a r e a   ! =   n u l l )  
 	 	 / /                 {  
 	 	 / /                         t a r e a . i n n e r H T M L   =   ' < t e x t a r e a   i d = " i n n e r C o n v e r t e r "   s t y l e = " o v e r f l o w : v i s i b l e " > '   +   H T M L T e x t   +   ' < / t e x t a r e a > ' ;    
 	 	 / /                         H T M L T e x t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " i n n e r C o n v e r t e r " ) . v a l u e ;  
 	 	 / /                         t a r e a . i n n e r H T M L     =   ' ' ;  
 	 	 / /                 }  
 	 	 	 	 v a r   H T M L T e x t 1   =   H T M L T e x t ;  
 	 	 	 	 H T M L T e x t 1   =   R e p l a c e A l l ( H T M L T e x t , ' + ' , ' # # # # # ' ) ;  
 	 	 	 	 / / H T M L T e x t 1   =   H T M L T e x t . r e p l a c e ( e v a l ( ' / & / g ' ) , ' # # # # # ' ) ;  
 	 	 	 	 H T M L T e x t 1   =   e n c o d e U R I C o m p o n e n t ( H T M L T e x t 1 ) ;  
 	 	 	 	 / / H T M L T e x t = r e p l a c e E x t C h a r s ( H T M L T e x t , t r u e ) ;  
 	 	 	 	 v a r   r e s u l t = 1 ; / /   D o A j a x C a l l F o r F o c u s P a g e ( v e n d o r N a m e ,   C o n t r o l I d ,   t i t l e , H T M L T e x t 1 , i s H T M L B o x ) ;  
 	 	 	 	 i f   ( r e s u l t   = =   0 )   {  
 	 	 	 	 	 a l e r t ( ' T h e r e   w a s   s o m e   e r r o r   i n   s a v i n g   d a t a . ' ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 t r y  
 	 	 	 	 	 {  
 	 	 	 	 	 	 / / t d . i n n e r H T M L   =     ' < a s p : L i t e r a l   I D = " l i t H T M L P r e v i e w C o n t e n t "   r u n a t = " s e r v e r " > '   +   H T M L T e x t + ' < / a s p : L i t e r a l > '   ;  
 	 	 	 	 	 	 t d . i n n e r H T M L   =     H T M L T e x t   ;  
 	 	 	 	 	 	 i f ( h i d d e n C o n f i g u r e H t m l D e s c ! = n u l l )  
 	 	 	 	 	 	 {   h i d d e n C o n f i g u r e H t m l D e s c . v a l u e = H T M L T e x t ; }  
 	 	 	 	 	 }  
 	 	 	 	 	   c a t c h   ( e r r ) { }  
  
 	 	 	 	 	 t d . s t y l e . h e i g h t   =   " a u t o " ;  
 	 	 	 	 	 i f   ( t d . p a r e n t N o d e   ! =   n u l l )   {  
 	 	 	 	 	 	 t d . p a r e n t N o d e . s t y l e . h e i g h t   =   " a u t o " ;  
 	 	 	 	 	 }  
 	 	 	 	 	 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l T i t l e   ! =   n u l l )   {  
 	 	 	 	 	 	 i f   ( ! i s f i r e F o x B r o w s e r )   {  
 	 	 	 	 	 	 	 l b l T i t l e . i n n e r T e x t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 	 	   l b l T i t l e . t i t l e = t x t T i t l e . v a l u e ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 	 l b l T i t l e . t e x t C o n t e n t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 i f ( h i d d e n C o n f i g u r e H t m l T i t l e ! = n u l l )  
 	 	 	 	 	 	 	   {   h i d d e n C o n f i g u r e H t m l T i t l e . v a l u e = t x t T i t l e . v a l u e ; }  
 	 	 	 	 	 }  
 	 	 	 	 	 / / l b l T i t l e . v a l u e = t x t T i t l e . 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 ( h i d d e n I s H t m l C l i e n t I D ) . v a l u e = " t r u e " ;  
 	 	 	 	 	  
 	 	 	 	 	 v a r   m p e   =   $ f i n d ( m p e I D ) ;  
 	 	 	 	 	 i f   ( m p e   ! =   n u l l )  
 	 	 	 	 	 {   m p e . h i d e ( ) ;   }  
 	 	 	 	 }  
  
 	 	 	 }  
 	 	  
 	 	 	 r e t u r n   t r u e ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	  
 	 	             / / S a v i n g   h t m l   b o x   d a t a  
 	 	             i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0   & &   t d I D   ! =   n u l l )   {  
 	 	 	 	 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
 	 	 	 	 v a r   H T M L T e x t   =   ' ' ;  
 	 	 	 	 v a r   t i t l e   =   ' ' ;  
                                 v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e C l i e n t I D ) ;  
 	 	 	 	 v a r   l b l T i t l e   =   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 T i t l e C l i e n t I D ) ;  
  
 	 	 	 	 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l T i t l e   ! =   n u l l )   {  
 	 	 	 	 	 t i t l e   =   t r i m ( t x t T i t l e . v a l u e ) ; }  
                                 i f   ( o E d i t o r   ! =   n u l l   & &   t d   ! =   n u l l )   {  
 	 	 	 	 	 H T M L T e x t   =   o E d i t o r . G e t H T M L ( ) ; } }  
                                 v a r   H T M L T e x t 1   =   H T M L T e x t ;  
  
 	 	 	 	 H T M L T e x t 1   =   R e p l a c e A l l ( H T M L T e x t , ' + ' , ' # # # # # ' ) ;  
                                 H T M L T e x t 1   =   e n c o d e U R I C o m p o n e n t ( H T M L T e x t 1 ) ;  
 / /                                 v a r   r e s u l t   =   D o A j a x C a l l F o r F o c u s P a g e ( v e n d o r N a m e ,   C o n t r o l I d ,   t i t l e , H T M L T e x t 1 , i s H T M L B o x ) ;  
 	                   	  
 	                   	 / / N o w   s a v i n g   P r o d u c t   b o x   D a t a 	                
 	 	 	 	 v a r   s t r   =   " " ;   i f   ( T r i m _ W h i t e _ S p a c e ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c T i t l e ) . v a l u e )   = =   " " )   {   s t r   =   s t r   +   " P l e a s e   e n t e r   \ " T i t l e \ " . " ;   }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( ! v a l i d a t e T e x t ( s r c T i t l e ,   f o r b i d d e n C h a r a c t e r s ) )  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 }  
 	 	 	 	 i f   ( T r i m _ W h i t e _ S p a c e ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c S u b T i t l e ) . v a l u e )   = =   " " )   {   s t r   =   s t r   +   " \ n P l e a s e   e n t e r   \ " S u b t i t l e \ " . " ;   }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( ! v a l i d a t e T e x t ( s r c S u b T i t l e ,   f o r b i d d e n C h a r a c t e r s ) )  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 }  
 / / 	 	 	 	 i f   ( T r i m _ W h i t e _ S p a c e ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c B r a n d N a m e ) . v a l u e )   = =   " " )   {   s t r   =   s t r   +   " \ n P l e a s e   s e l e c t   \ " M a n u f a c t u r e r \ " . " ;   }  
 / / 	 	 	 	 e l s e  
 / / 	 	 	 	 {  
 / / 	 	 	 	 	 i f   ( ! v a l i d a t e T e x t ( s r c B r a n d N a m e ,   f o r b i d d e n C h a r a c t e r s ) )  
 / / 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 / / 	 	 	 	 }  
 / / 	 	 	 	 i f   ( T r i m _ W h i t e _ S p a c e ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c C a t e g o r y N a m e ) . v a l u e )   = =   " " )   {   s t r   =   s t r   +   " \ n P l e a s e   s e l e c t   \ " C a t e g o r y \ " . " ;   }  
 / / 	 	 	 	 e l s e  
 / / 	 	 	 	 {  
 / / 	 	 	 	 	 i f   ( ! v a l i d a t e T e x t ( s r c C a t e g o r y N a m e ,   f o r b i d d e n C h a r a c t e r s ) )  
 / / 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 / / 	 	 	 	 }  
 	 	 	 	 i f   ( T r i m _ W h i t e _ S p a c e ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d u c t N a m e ) . v a l u e )   = =   " " )   {   s t r   =   s t r   +   " \ n P l e a s e   e n t e r   \ " M F G # \ " . " ;   }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( ! v a l i d a t e T e x t ( s r c P r o d u c t N a m e ,   f o r b i d d e n C h a r a c t e r s ) )  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 }  
 	 	 	 	 v a r   p r o d u c t L i n k   =   n u l l ;  
 / / 	 	 	 	 p r o d u c t L i n k   =   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d L i n k ) ;  
 / / 	 	 	 	 i f   ( p r o d u c t L i n k   ! =   n u l l   & &   p r o d u c t L i n k . v a l u e   ! =   n u l l  
 / / 	 	 	 	 	 & &   T r i m _ W h i t e _ S p a c e ( p r o d u c t L i n k . v a l u e )   ! =   ' '  
 / / 	 	 	 	 	 & &   T r i m _ W h i t e _ S p a c e ( p r o d u c t L i n k . v a l u e . t o L o w e r C a s e ( ) )   ! =   ' a u t o ' )    
 / / 	 	 	 	 {    
 / / 	 	 	 	 	 v a r   v a l i d U R L   =   V a l i d a t e U R L ( p r o d u c t L i n k . v a l u e ) ;  
 / / 	 	 	 	 	 i f ( v a l i d U R L   = =   f a l s e )  
 / / 	 	 	 	 	 {  
 / / 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 / / 	 	 	 	 	 }  
 / / 	 	 	                  
 / / 	 	 	 	   }  
 	 	 	        
 	 	 	 	 i f   ( s t r   ! =   " " )   {   a l e r t ( s t r ) ;   r e t u r n   f a l s e ;   }  
 	 	 	 	 v a r   r d b F i l t e r F e a t u r e d   =   d o c u m e n t . g e t E l e m e n t B y I d ( r d b F i l t e r F e a t u r e d C l i e n t I D ) ;  
 	 	 	 	 v a r   r d b F i l t e r N o n e   =   d o c u m e n t . g e t E l e m e n t B y I d ( r d b F i l t e r N o n e C l i e n t I D ) ;  
 	 	 	 	 v a r   i s F e t a u r e d   =   0 ;  
 	 	 	 	 i f   ( r d b F i l t e r F e a t u r e d   ! =   n u l l   & &   r d b F i l t e r F e a t u r e d   ! =   n u l l )  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( r d b F i l t e r F e a t u r e d . c h e c k e d   = =   t r u e )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 i s F e t a u r e d   =   1 ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 v a r   i f P r o d u c t E x i s t s   =   D o e s P r o d u c t E x i s t A s P e r C r i t e r i a ( p a g e I d ,   c o n t r o l I d ,   e n t i t y I d , A g e n c y I d , I s A g e n c y G r o u p ,   s r c B r a n d I d ,   s r c C a t e g o r y I d ,   s r c P r o d u c t I d ,   s r c C r i t e r i a B r a n d ,   s r c C r i t e r i a C a t e g o r y ,   s r c C r i t e r i a P r o d u c t ,   i s F e t a u r e d ) ;  
 	 	 	 	 i f   ( i f P r o d u c t E x i s t s   = =   " f a l s e " )  
 	 	 	 	 {   a l e r t ( " N o   P r o d u c t   f o u n d   a s   p e r   t h e   s p e c i f i e d   c r i t e r i a . " ) ;   r e t u r n   f a l s e ;   }  
 	 	 	 	 i f   ( i f P r o d u c t E x i s t s   = =   " D u p l i c a t e P r o d u 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 ( h i d d e n I s H t m l C l i e n t I D ) . v a l u e = = " t r u e " )  
 	 	 	 	       t r H t m l B o x B o x . s t y l e . d i s p l a y = ' ' ;  
 	 	 	 	     e l s e  
     	 	 	 	       t r P r o d u c t B o x . s t y l e . d i s p l a y = ' ' ;  
 	 	 	 	 	     a l e r t ( " P r o d u c t   a l r e a d y   e x i s t   i n   t h e   p a g e   i n   o t h e r   M e r c h a n d i z e B o x . " ) ;  
 	 	 	 	     r e t u r n   f a l s 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 ( d d l P r o d u c t ) . v a l u e   = =   " 1 " )  
 / / 	 	 	 	 {  
                                         d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n I s H t m l C l i e n t I D ) . v a l u e = " f a l s e " ;  
 	 	 	 	 	 v a r   p a r a m e t e r   =   c h e c k F o r M f g N u m b e r ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d u c t N a m e ) . v a l u e ) ;    
 	 	 	 	 	 i f   ( p a r a m e t e r   = =   " - 1 " )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 a l e r t ( " I n v a l i d   P r o d u c t   N u m b e r   " ) ;   r e t u r n   f a l s e ; }  
 	 	 	 	 	 	   v a r   r e t u r n R e s u l t   =   p a r a m e t e r . s p l i t ( " µ " ) ;   i f   ( r e t u r n R e s u l t   ! =   ' '   & &   r e t u r n R e s u l t   ! =   n u l l   & &   r e t u r n R e s u l t   ! =   u n d e f i n e d   & &   r e t u r n R e s u l t . l e n g t h   > =   9 )  
 	 	 	 	 	 	 {   d o c u m e n t . g e t E l e m e n t B y I d ( s r c C a t e g o r y I d ) . v a l u e   =   r e t u r n R e s u l t [ 1 ] ;   d o c u m e n t . g e t E l e m e n t B y I d ( s r c B r a n d I d ) . v a l u e   =   r e t u r n R e s u l t [ 2 ] ;   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d u c t I d ) . v a l u e   =   r e t u r n R e s u l t [ 3 ] ;   d o c u m e n t . g e t E l e m e n t B y I d ( s r c C a t e g o r y N a m e ) . v a l u e   =   r e t u r n R e s u l t [ 4 ] ;   d o c u m e n t . g e t E l e m e n t B y I d ( s r c B r a n d N a m e ) . v a l u e   =   r e t u r n R e s u l t [ 5 ] ;   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d I m a g e U r l ) . v a l u e   =   r e t u r n R e s u l t [ 6 ] ;   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d P r i c e ) . v a l u e   =   " $ "   +   r e t u r n R e s u l t [ 7 ] ;   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d M a i n F e a t u r e s ) . v a l u e   =   r e t u r n R e s u l t [ 8 ] ;   }  
 	 	 	 	 	  
 	 	 	 	 / / }  
 / / 	 	 	 	 v a r   f o r m a t   =   d o c u m e n t . g e t E l e m e n t B y I d ( h d n F o r m a t ) . v a l 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 ( s r c R b t n A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c R b t n B )   ! =   n u l l )  
 / / 	 	 	 	 {  
 / / 	 	 	 	 	 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c R b t n A ) . c h e c k e d   = =   t r u e )  
 / / 	 	 	 	 	 {   f o r m a t   =   " A "   }  
 / / 	 	 	 	 	 e l s 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 ( s r c R b t n B ) . c h e c k e d   = =   t r u e )  
 / / 	 	 	 	 	 {   f o r m a t   =   " B "   } ;  
 / / 	 	 	 	 }  
                              
 	 	 	 	 v a r   f i l t e r s   =   s r c F i l t e r s . s p l i t ( ' | | ' ) ;   v a r   f i l t e r   =   " " ;    
 	 	 	         v a r   c h e c k b o x F i l t e r = d o c u m e n t . g e t E l e m e n t B y I d ( f i l t e r s [ 0 ] ) ;  
 	 	 	 	 i f   ( c h e c k b o x F i l t e r ! = n u l l   & &   c h e c k b o x F i l t e r . C h e c k e d )  
 	 	 	 	 {   f i l t e r   =   " 1 " ;   }  
 	 	 	 	 e l s e  
 	 	 	 	 {   f i l t e r   =   " 0 " ;   }  
 	 	 	 	 i f   ( A g e n c y I d   = =   u n d e f i n e d   | |   A g e n c y I d   = =   n u l l )  
 	 	 	 	 {  
         	 	 	 	 A g e n c y I d   =   - 1 ;  
 	 	 	 	 }  
 	 	 	 	 i f   ( I s A g e n c y G r o u p   = =   u n d e f i n e d   | |   I s A g e n c y G r o u p   = =   n u l l )  
 	 	 	 	 {  
         	 	 	 	 I s A g e n c y G r o u p   =   f a l s e ;  
 	 	 	 	 }  
  
 	 	 	 	 v a r   i d e n t i f i c a t i o n   =   p a g e I d   +   " , "   +   c o n t r o l I d   +   " , "   +   e n t i t y I d   +   " , "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c M e r c h a n d i z e B o x I d ) . v a l u e   +   " , "   +   A g e n c y I d   +   " , "   +   I s A g e n c y G r o u p ;  
 	 	 	 	   v a r   v a l u e s   =   i d e n t i f i c a t i o n   +   "   µ "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c T i t l e ) . v a l u e . t r i m ( )   +   "   µ "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S u b T i t l e ) . v a l u e . t r i m ( )    
 	 	 	 	 	 	 +   "   µ "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c C r i t e r i a B r a n d ) . 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 r c B r a n d I d ) . 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 r c B r a n d N a m e ) . 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 r c C r i t e r i a C a t e g o r y ) . 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 r c C a t e g o r y I d ) . 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 r c C a t e g o r y N a m e ) . 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 r c C r i t e r i a P r o d u c t ) . 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 r c P r o d u c t I d ) . v a l u e . s p l i t ( " # # # " ) [ 0 ]   +   "   µ "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d u c t N a m e ) . v a l u e    
 	 	 	 	 	 	 +   "   µ "   +   " 1 "   +   "   µ "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S h o w P r i c e ) . 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 r c P r o d L i n k ) . v a l u e   +   "   µ "   +   f i l t e r   +   "   µ "   +   " B "   +   "   µ "    
 	 	 	 	 	 	 +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d I m a g e U r l ) . v a l u e   +   "   " ;   v a r   p o p u p s   =   p o p u p . s p l i t ( ' | | ' ) ;  
 / / 	 	 	 	 	 	   v a r   e f f e c t i v e M p 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 ( h d n F o r m a t ) . v a l u e   = =   " A " )  
 / / 	 	 	 	 {   e f f e c t i v e M p e   =   p o p u p s [ 0 ] ;   }  
 / / 	 	 	 	 e l s 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 ( h d n F o r m a t ) . v a l u e   = =   " B " )  
 / / 	 	 	 	 {   e f f e c t i v e M p e   =   p o p u p s [ 1 ] ;   }  
 / / 	 	 	 	 $ f i n d ( e f f e c t i v e M p e ) . h i d e ( ) ;    
  
 	 	 	 	 v a r   m p e   =   $ f i n d ( m p e I D ) ;  
 	 	 	 	 	 i f   ( m p e   ! =   n u l l )  
 	 	 	 	 	 {   m p e . h i d e ( ) ;   }  
 	 	 	 	  
 	 	 	 	 v a r   r e g E x p r e s s i o n   =   n e w   R e g E x p ( " & " ,   " g " ) ;   v a l u e s   =   v a l u e s . r e p l a c e ( r e g E x p r e s s i o n ,   ' ^ ' ) ;  
 	 	 	 	 v a r   p a g e i d s   =   I s C o n t e x t P a g e   +   ' @ @ @ @ '   +   P a g e C o n t e x t I D   +   ' @ @ @ @ '   +   A g e n c y I d   + ' @ @ @ @ '   +   I s A g e n c y G r o u p ;  
 	 	 	 	  
 	 	 	 	 v a r   r e s u l t P r o d u c t B o x   =   P B 1 D o A j a x C a l l ( v a l u e s , p a g e i d s ) ;  
 	 	 	 	 i f ( H T M L T e x t 1   = =   n u l l   | |   H T M L T e x t 1   = =   u n d e f i n e d )  
 	 	 	 	 {  
 	 	 	 	 	 H T M L T e x t 1   =   ' ' ;  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	  
 	 	 	 	  
 	 	 	 	 i f ( t i t l e   = =   n u l l   | |   t i t l e   = =   u n d e f i n e d )  
 	 	 	 	 {  
 	 	 	 	 	 t i t l e   =   ' ' ;  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e s u l t P r o d u c t B o x   ! =   " 0 "   & &   r e s u l t P r o d u c t B o x   ! =   n u l l )   { v a r   m e r c h a n d i z e B o x I d f o r V e n d o r P a g e   =   d o c u m e n t . g e t E l e m e n t B y I d ( s r c M e r c h a n d i z e B o x I d ) ;       i f ( m e r c h a n d i z e B o x I d f o r V e n d o r P a g e   ! =   n u l l   & &   ( m e r c h a n d i z e B o x I d f o r V e n d o r P a g e . v a l u e   = =   n u l l   | |   m e r c h a n d i z e B o x I d f o r V e n d o r P a g e . v a l u e   = =   u n d e f i n e d   | |   t r i m ( m e r c h a n d i z e B o x I d f o r V e n d o r P a g e . v a l u e )   = =   ' ' ) )   {   m e r c h a n d i z e B o x I d f o r V e n d o r P a g e . v a l u e   =   r e s u l t P r o d u c t B o x ;   }          
 	 	 	 	 v a r   r e s u l t   =   D o A j a x C a l l F o r F o c u s P a g e ( v e n d o r N a m e ,   C o n t r o l I d ,   t i t l e , H T M L T e x t 1 , f a l s 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 ( h d n F o r m a t )   ! =   n u l l )   { d o c u m e n t . g e t E l e m e n t B y I d ( h d n F o r m a t ) . v a l u e   =   f o r m a t ; }   }  
 	 	 	 	  
 	 	 	 	 V e n d o r P a g e P r o d u c t B o x P r e v i e w ( h i d d e n P r o d u c t L i n k , s r c B r a n d I d ,   s r c C a t e g o r y I d ,   s r c P r o d u c t I d ,   s r c T i t l e ,   s r c S u b T i t l e ,   s r c S h o w P r i c e ,   s r c P r o d P r i c e ,   s r c P r o d I m a g e U r l ,  
 	 	 	 	                                                         s r c P r o d M a i n F e a t u r e s ,   s r c R b t n A ,   s r c R b t n B ,   s r c C r i t e r i a B r a n d ,   s r c C r i t e r i a C a t e g o r y ,   s r c C r i t e r i a P r o d u c t ,   t g t T i t l e A ,  
 	 	 	 	                                                         t g t S u b T i t l e A ,   t g t P r o d I m a g e A ,   t g t P r i c e D i v A ,   t g t P r o d P r i c e A ,   t g t P r o d M a i n F e a t u r e s A ,   t g t D i v A ,   t g t T i t l e B ,   t g t S u b T i t l e B ,    
 	 	 	 	                                                         t g t P r o d I m a g e B ,   t g t P r i c e D i v B ,   t g t P r o d P r i c e B ,   t g t P r o d M a i n F e a t u r e s B ,   t g t D i v B ,   h d n F o r m a t ,   n u l l ,   n u l l ,   n u l l ) ;  
 	 	 	 	   d o c u m e n t . g e t E l e m e n t B y I d ( d d l B r a n d S e l e c t e d ) . 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 r c C r i t e r i a B r a n d ) . 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 ( d d l C a t e g o r y S e l e c t e d ) . 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 r c C r i t e r i a C a t e g o r y ) . 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 ( d d l P r o d u c t S e l e c t e d ) . 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 r c C r i t e r i a P r o d u c t ) . v a l u e ;    
 	 	 	 	   v a r   h d n F i e l d s   =   h d n H i d d e n F i e l d s . s p l i t ( " | | " ) ;   d o c u m e n t . g e t E l e m e n t B y I d ( h d n F i e l d s [ 0 ] ) . 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 r c T i t l e ) . v a l u e . t r i m ( ) ;    
 	 	 	 	   d o c u m e n t . g e t E l e m e n t B y I d ( h d n F i e l d s [ 1 ] ) . 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 r c S u b T i t l e ) . v a l u e . t r i m ( ) ;    
 	 	 	 	   d o c u m e n t . g e t E l e m e n t B y I d ( h d n F i e l d s [ 2 ] ) . 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 r c C r i t e r i a B r a n d ) . 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 ( h d n F i e l d s [ 3 ] ) . 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 r c C r i t e r i a C a t e g o r y ) . 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 ( h d n F i e l d s [ 4 ] ) . 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 r c C r i t e r i a P r o d u c t ) . 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 ( h d n F i e l d s [ 5 ] ) . 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 r c B r a n d N a m e ) . 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 ( h d n F i e l d s [ 6 ] ) . 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 r c C a t e g o r y N a m e ) . 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 ( h d n F i e l d s [ 7 ] ) . 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 r c P r o d u c t N a m e ) . 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 ( h d n F i e l d s [ 8 ] ) . 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 r c F r e q u e n c y ) . 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 ( h d n F i e l d s [ 9 ] ) . 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 r c S h o w P r i c e ) . 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 ( h d n F i e l d s [ 1 0 ] ) . 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 r c P r o d L i n k ) . 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 ( h d n F i e l d s [ 1 1 ] ) . v a l u e   =   f i l t e r ;   v a r   d r p P r o d u c t   =   d o c u m e n t . g e t E l e m e n t B y I d ( d d l P r o d u c t ) ;  
 	 	 	 	   t r P r o d u c t B o x . s t y l e . d i s p l a y = ' ' ;    
 	 	 	 	   r e t u r n   f a l s e ;  
 	 	 	 	    
 	 	 } 	  
         }  
         m y M P E . h i d e ( ) ;  
          
         r e t u r n   f a l s e ;  
 }  
  
  
 f u n c t i o n   V e n d o r P a g e P r o d u c t B o x P r e v i e w ( h i d d e n P r o d u c t L i n k ,   s r c H i d B r a n d I D ,   s r c H i d C a t e g o r y I D ,   s r c H i d P r o d u c t I D ,   s r c T i t l e ,   s r c S u b T i t l e ,   s r c S h o w P r i c e ,   s r c P r o d P r i c e ,   s r c P r o d I m a g e U r l ,    
                                                                           s r c M a i n F e a t u r e s ,   s r c R b t n A ,   s r c R b t n B ,   s r c S e l C r i t e r i a B r a n d ,   s r c S e l C r i t e r i a C a t e g o r y ,   s r c S e l C r i t e r i a P r o d u c t ,   t g t T i t l e A ,    
                                                                           t g t S u b T i t l e A ,   t g t P r o d I m a g e A ,   t g t P r i c e D i v A ,   t g t P r o d P r i c e A ,   t g t P r o d M a i n F e a t u r e s A ,   t g t D i v A ,   t g t T i t l e B ,   t g t S u b T i t l e B ,   t g t P r o d I m a g e B ,    
                                                                           t g t P r i c e D i v B ,   t g t P r o d P r i c e B ,   t g t P r o d M a i n F e a t u r e s B ,   t g t D i v B ,   h d n F o r m a t ,   p o p U p ,   b u t t o n I D s ,   m p e P r e v i e w I D ,   r d b F i l t e r N o n e C l i e n t I D ,  
                                                                           r d b F i l t e r F e a t u r e d C l i e n t I D ,   l b l A P r i c e P r e f i x P r e v i e w C l i e n t I D ,   l b l B P r i c e P r e f i x P r e v i e w C l i e n t I D , t e x t F o r P r i c e T o B e s h o w n I n C a r t ,  
                                                                           h o v e r T e x t F o r P r i c e T o B e s h o w n I n C a r t )  
 {  
 / /         f o r m a t   =   d o c u m e n t . g e t E l e m e n t B y I d ( h d n F o r m a t ) . v a l 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 ( s r c R b t n A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c R b t n B )   ! =   n u l l )  
 / /         {  
 / /                 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c R b t n A ) . c h e c k e d   = =   t r u e )  
 / /                 {   f o r m a t   =   " A " ;   }  
 / /                 e l s 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 ( s r c R b t n B ) . c h e c k e d   = =   t r u e )  
 / /                 {   f o r m a t   =   " B " ;   }  
 / /         }  
  
 	 f o r m a t   =   " B " ;  
  
         v a r   r d b F i l t e r F e a t u r e d   =   d o c u m e n t . g e t E l e m e n t B y I d ( r d b F i l t e r F e a t u r e d C l i e n t I D ) ;  
         v a r   r d b F i l t e r N o n e   =   d o c u m e n t . g e t E l e m e n t B y I d ( r d b F i l t e r N o n e C l i e n t I D ) ;  
         v a r   i s F e t a u r e d   =   0 ;  
       i f   ( r d b F i l t e r F e a t u r e d   ! =   n u l l   & &   r d b F i l t e r F e a t u r e d   ! =   n u l l )  
         {  
                 i f   ( r d b F i l t e r F e a t u r e d . c h e c k e d   = =   t r u e )  
                 {  
                         i s F e t a u r e d   =   1 ;  
                 }  
         }  
          
         v a r   l b l A P r i c e P r e f i x P r e v i e w   =   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 A P r i c e P r e f i x P r e v i e w C l i e n t I D ) ;  
         v a r   l b l B P r i c e P r e f i x P r e v i e w   =   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 B P r i c e P r e f i x P r e v i e w C l i e n t I D ) ;  
         v a r   p r o d u c t P a r t N u m b e r   =   " " ;  
        
         p r o d u c t P a r t N u m b e r   + =   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S e l C r i t e r i a B r a n d ) . 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 r c H i d B r a n d I D ) . v a l u e ;  
         p r o d u c t P a r t N u m b e r   + =   " , "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S e l C r i t e r i a C a t e g o r y ) . 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 r c H i d C a t e g o r y I D ) . v a l u e ;  
         p r o d u c t P a r t N u m b e r   + =   " , "   +   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S e l C r i t e r i a P r o d u c t ) . 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 r c H i d P r o d u c t I D ) . v a l u e   +   " , "   +   i s F e t a u r e d ;  
          
         v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " F e t c h P r o d u c t D e t a i l s = "   +   p r o d u c t P a r t N u m b e r ;   v a r   r e s u l t   =   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;  
         i f   ( ! ( r e s u l t   ! =   n u l l   & &   r e s u l t . l e n g t h   >   0 ) )  
         {  
                 i f   ( r e s u l t   = =   ' D u p l i c a t e P r o d u c t ' )  
                 {  
                         a l e r t ( ' T h e r e   i s   a n o t h e r   M e r c h a n d i z e   B o x   i n   t h e   P a g e   c o n t a i n i n g   s a m e   p r o d u c t . ' ) ;  
                 }  
                 e l s e   {   a l e r t ( " N o   P r o d u c t   f o u n d   a s   p e r   t h e   s p e c i f i e d   c r i t e r i a . " ) ;   }   v a r   m p e P r e v i e w   =   $ f i n d ( m p e P r e v i e w I D ) ;   i f   ( m p e P r e v i e w   ! =   n u l l )  
                 {   m p e P r e v i e w . h i d e ( ) ;   }  
                 r e t u r n   f a l s e ;  
         }  
          
         v a r   p r o d u c t s   =   r e s u l t . s p l i t ( " µ " ) ;   v a r   p r o p e r t i e s ;   i f   ( p r o d u c t s   ! =   n u l l   & &   p r o d u c t s . l e n g t h   >   0 )   {   p r o p e r t i e s   =   p r o d u c t s [ 0 ] . s p l i t ( " a"" ) ;   }  
         i f   ( ! ( p r o p e r t i e s   ! =   n u l l   & &   p r o p e r t i e s . l e n g t h   >   0 ) )   {   a l e r t ( " S o m e   e r r o r   o c c u r e d   d u r i n g   p r e v i e w .   P l e a s e   t r y   a g a i n   l a t e r . " ) ;   r e t u r n   f a l s e ;   }  
         v a r   t e m p T i t l e   =   " " ;   v a r   t e m p S u b T i t l 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 ( s r c T i t l e ) . v a l u e . t r i m ( ) . t o U p p e r C a s e ( )   = =   " A U T O " )  
                 t e m p T i t l e   =   p r o p e r t i e s [ 0 ] ;   e l s e  
                 t e m p T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( s r c T i t l e ) . v a l u e . t r i m ( ) ;   i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( s r c S u b T i t l e ) . v a l u e . t r i m ( ) . t o U p p e r C a s e ( )   = =   " A U T O " )  
                 t e m p S u b T i t l e   =   p r o p e r t i e s [ 1 ] ;   e l s e  
                 t e m p S u b T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S u b T i t l e ) . v a l u e . t r i m ( ) ;    
         i f   ( f o r m a t   = =   " A " )  
         {  
                 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( t g t D i v A )   ! =   n u l l )  
                         d o c u m e n t . g e t E l e m e n t B y I d ( t g t D i v A ) . s t y l e . d i s p l a y   =   ' ' ;   i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( t g t D i v B )   ! =   n u l l )  
                         d o c u m e n t . g e t E l e m e n t B y I d ( t g t D i v B ) . s t y l e . d i s p l a y   =   ' n o n 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 ( t g t T i t l e A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c T i t l e )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t T i t l e A ) . i n n e r H T M L   =   G e t T r i m T e x t ( t e m p T i t l e ,   5 0 ) ;   d o c u m e n t . g e t E l e m e n t B y I d ( t g t T i t l e A ) . t i t l e   =   t e m p T i t l 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 ( t g t S u b T i t l e A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S u b T i t l e )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t S u b T i t l e A ) . i n n e r H T M L   =   G e t T r i m T e x t ( t e m p S u b T i t l e ,   5 0 ) ;   d o c u m e n t . g e t E l e m e n t B y I d ( t g t S u b T i t l e A ) . t i t l e   =   t e m p S u b T i t l 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 ( s r c S h o w P r i c e )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r i c e D i v A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S h o w P r i c e ) . v a l u e   = =   " 1 " )  
                 {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r i c e D i v A ) . s t y l e . d i s p l a y   =   ' ' ;   }  
                 e l s 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 ( t g t P r i c e D i v A )   ! =   n u l l )  
                 {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r i c e D i v A ) . s t y l e . d i s p l a y   =   ' n o n 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 ( t g t P r o d P r i c e A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d P r i c e )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d P r i c e A ) . i n n e r H T M L   =   p r o p e r t i e s [ 3 ] ;   i f   ( p r o p e r t i e s [ 3 ]   = =   t e x t F o r P r i c e T o B e s h o w n I n C a r t )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d P r i c e A ) . t i t l e   =   h o v e r T e x t F o r P r i c e T o B e s h o w n I n C a r 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 ( t g t P r o d I m a g e A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d I m a g e U r l )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d I m a g e A ) . s r c   =   p r o p e r t i e s [ 4 ] . t r i m ( ) ;   }  
                 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d M a i n F e a t u r e s A )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c M a i n F e a t u r e s )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d M a i n F e a t u r e s A ) . i n n e r H T M L   =   G e t B u l l e t e d L i s t ( p r o p e r t i e s [ 5 ] ,   " | | | " ,   ' 3 ' ) ;   }  
                 i f   ( l b l A P r i c e P r e f i x P r e v i e w   ! =   n u l l )   {   i f   ( p r o p e r t i e s [ 6 ]   = =   ' t r u e ' )   {   l b l A P r i c e P r e f i x P r e v i e w . i n n e r H T M L   =   " O n l y " ;   i f   ( p r o p e r t i e s [ 3 ]   ! =   t e x t F o r P r i c e T o B e s h o w n I n C a r t   & &   p r o p e r t i e s [ 3 ]   = =   ' C a l l ' )   { l b l A P r i c e P r e f i x P r e v i e w . i n n e r H T M L   =   " & n b s p ; " ;   }   }   e l s e   {   l b l A P r i c e P r e f i x P r e v i e w . i n n e r H T M L   =   " & n b s p ; "   }   }  
         }  
         e l s e   i f   ( f o r m a t   = =   " B " )  
         {  
                 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( t g t D i v A )   ! =   n u l l )  
                         d o c u m e n t . g e t E l e m e n t B y I d ( t g t D i v A ) . s t y l e . d i s p l a y   =   ' n o n 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 ( t g t D i v B )   ! =   n u l l )  
                         d o c u m e n t . g e t E l e m e n t B y I d ( t g t D i v B ) . s t y l e . d i s p l a y   =   ' ' ;   i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( t g t T i t l e B )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c T i t l e )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t T i t l e B ) . i n n e r H T M L   =   G e t T r i m T e x t ( t e m p T i t l e ,   2 1 ) ;   d o c u m e n t . g e t E l e m e n t B y I d ( t g t T i t l e B ) . t i t l e   =   t e m p T i t l e ; }  
                           / / i f ( ! ( t g t T i t l e B . i n d e x O f ( " l b l P r e v i e w " ) > - 1 ) ) { d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d I m a g e B ) . o n c l i c k = " j a v a s c r i p t : l o c a t i o n . h r e f = ( ' " + d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n P r o d u c t L i n k ) . v a l u e + " ? p r o d u c t I d = " + d o c u m e n t . g e t E l e m e n t B y I d ( s r c H i d P r o d u c t I D ) . v a l u e + " ' ) ;   r e t u r n   f a l s 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 ( t g t S u b T i t l e B )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S u b T i t l e )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t S u b T i t l e B ) . i n n e r H T M L   =   G e t T r i m T e x t ( t e m p S u b T i t l e ,   5 0 ) ;   d o c u m e n t . g e t E l e m e n t B y I d ( t g t S u b T i t l e B ) . t i t l e   =   t e m p S u b T i t l 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 ( s r c S h o w P r i c e )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r i c e D i v B )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c S h o w P r i c e ) . v a l u e   = =   " 1 " )  
                 {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r i c e D i v B ) . s t y l e . d i s p l a y   =   ' ' ;   }  
                 e l s 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 ( t g t P r i c e D i v B )   ! =   n u l l )  
                 {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r i c e D i v B ) . s t y l e . d i s p l a y   =   ' n o n 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 ( t g t P r o d P r i c e B )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d P r i c e )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d P r i c e B ) . i n n e r H T M L   =   p r o p e r t i e s [ 3 ] ;   i f   ( p r o p e r t i e s [ 3 ]   = =   t e x t F o r P r i c e T o B e s h o w n I n C a r t )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d P r i c e B ) . t i t l e   =   h o v e r T e x t F o r P r i c e T o B e s h o w n I n C a r 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 ( t g t P r o d I m a g e B )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c P r o d I m a g e U r l )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d I m a g e B ) . s r c   =   p r o p e r t i e s [ 4 ] . t r i m ( ) ;   }  
                 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d M a i n F e a t u r e s B )   ! =   n u l l   & &   d o c u m e n t . g e t E l e m e n t B y I d ( s r c M a i n F e a t u r e s )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( t g t P r o d M a i n F e a t u r e s B ) . i n n e r H T M L   =   G e t B u l l e t e d L i s t ( p r o p e r t i e s [ 5 ] ,   " | | | " ,   ' 3 ' ) ;   }  
                 i f   ( l b l B P r i c e P r e f i x P r e v i e w   ! =   n u l l )   {   i f   ( p r o p e r t i e s [ 6 ]   = =   ' t r u e ' )   { l b l B P r i c e P r e f i x P r e v i e w . i n n e r H T M L   =   " O n l y " ;   i f   ( p r o p e r t i e s [ 3 ]   ! =   t e x t F o r P r i c e T o B e s h o w n I n C a r t   & &   p r o p e r t i e s [ 3 ]   = =   ' C a l l ' )   { l b l B P r i c e P r e f i x P r e v i e w . i n n e r H T M L   =   " & n b s p ; " ;   }   }   e l s e   {   l b l B P r i c e P r e f i x P r e v i e w . i n n e r H T M L   =   " & n b s p ; "   }   }  
                  
         }  
 / /         i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( p o p U p )   ! =   n u l l   & &   S t r i n g ( d o c u m e n t . g e t E l e m e n t B y I d ( p o p U p ) . d i s a b l e d )   = =   ' t r u e ' )  
 / /                 r e t u r n   f a l s e ;   e l s 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 ( p o p U p )   ! =   n u l l )   {   d o c u m e n t . g e t E l e m e n t B y I d ( p o p U p ) . d i s a b l e d   =   t r u e ;   D i s a b l e B u t t o n s ( b u t t o n I D s ,   ' | | | ' ,   t r u e ) ;   }  
  
 	 D i s a b l e B u t t o n s ( b u t t o n I D s ,   ' | | | ' ,   t r u e ) ;  
  
         i f   ( m p e P r e v i e w I D   ! =   u n d e f i n e d   & &   m p e P r e v i e w I D   ! =   n u l l )  
         {  
                 v a r   m p e P r e v i e w   =   $ f i n d ( m p e P r e v i e w I D ) ;   i f   ( m p e P r e v i e w   ! =   n u l l )  
                 {   m p e P r e v i e w . s h o w ( ) ;   }  
         }  
 }  
  
  
  
 f u n c t i o n   D o A j a x C a l l F o r F o c u s P a g e ( v e n d o r N a m e ,   t y p e ,   t i t l e ,   H T M L T e x t , i s H T M L B o x )   {  
         v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;  
         v a r   q S t r i n g   =   " F o c u s P a g e M B T y p e = "   +   t y p e   +   ' | | | '   +   v e n d o r N a m e   +   ' | | | '   +   t i t l e   +   ' | | | '   +   H T M L T e x t   +   ' | | | '   +   i s H T M L B o x . t o S t r i n g ( ) ;  
         r e t u r n   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;  
 }  
  
 f u n c t i o n   R e s e t M B B o x f o r F o c u s P a g e ( h e a d T i t l e C l i e n t I D ,   t d H t m l C o n t e n t C l i e n t I D , t x t T i t l e I D , f c k C l i e n t I D , h i d I s H t m l C l i e n t I D , t g t T i t l e ,   t g t S u b T i t l e ,   t g t S e l C r i t e r i a B r a n d ,   t g t S e l C r i t e r i a C a t e g o r y ,    
                                                                 t g t S e l C r i t e r i a P r o d u c t ,   t g t B r a n d N a m e ,   t g t C a t e g o r y N a m e , t g t P r o d u c t N a m e ,   t g t F r e q u e n c y ,   t g t S h o w P r i c e ,   t g t P r o d L i n k ,   t g t F i l t e r I d s ,  
                                                                 t g t F o r m a t I d s ,   t g t B t n B r a n d ,   t g t B t n C a t e g o r y ,   t g t B t n P r o d u c t ,   r a d i o B u t t o n H t m l B o x , r a d i o B u t t o n P r o d u c t B o x , t r H t m l B o x C l i e n t I D , t r P r o d u c t B o x C l i e n t I D , m y M P E C l i e n t I D )  
   {  
       v a r   m y M P E = $ f i n d ( m y M P E C l i e n t I D ) ;  
       v a r   i s H t m l = d o c u m e n t . g e t E l e m e n t B y I d ( h i d I s H t m l C l i e n t I D ) ;  
       v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e I D ) ;  
        
       i f ( i s H t m l . v a l u e = = " t r u e " )  
       {    
           v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
           v a r   l b l T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( h e a d T i t l e C l i e n t I D ) ;  
           v a r   t d H t m l   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d H t m l C o n t e n t C l i e n t I D ) ;  
          
          
         i f   ( o E d i t o r   ! =   n u l l   & &   t d H t m l   ! =   n u l l )   {  
                 i f ( t d H t m l . i n n e r H T M L   ! =   n u l l )  
                         o E d i t o r . S e t H T M L ( t d H t m l . i n n e r H T M L )  
         }  
         i f ( l b l T i t l e   ! =   n u l l   & &   t x t T i t l e   ! =   n u l l )  
         {  
                 t x t T i t l e . v a l u e   =   t r i m ( l b l T i t l e . i n n e r T e x 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 ( r a d i o B u t t o n H t m l B o x ) ! = n u l l )  
         {  
             d o c u m e n t . g e t E l e m e n t B y I d ( r a d i o B u t t o n H t m l B o x ) . c h e c k e d = t r u e ;  
             d o c u m e n t . g e t E l e m e n t B y I d ( t r H t m l B o x C l i e n t I D ) . s t y l e . d i s p l a y = ' ' ;  
             d o c u m e n t . g e t E l e m e n t B y I d ( t r P r o d u c t B o x C l i e n t I D ) . s t y l e . d i s p l a y = ' n o n e ' ;  
         }  
     }  
     e l s e {  
           P B 1 C a n c e l C l i c k e d ( t g t T i t l e ,   t g t S u b T i t l e ,   t g t S e l C r i t e r i a B r a n d ,   t g t S e l C r i t e r i a C a t e g o r y ,   t g t S e l C r i t e r i a P r o d u c t ,   t g t B r a n d N a m e ,  
                                           t g t C a t e g o r y N a m e , t g t P r o d u c t N a m e ,   t g t F r e q u e n c y ,   t g t S h o w P r i c e ,   t g t P r o d L i n k ,   t g t F i l t e r I d s ,  
                                           t g t F o r m a t I d s ,   t g t B t n B r a n d ,   t g t B t n C a t e g o r y ,   t g t B t n P r o d u 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 ( r a d i o B u t t o n P r o d u c t B o x ) ! = n u l l )  
         {  
             d o c u m e n t . g e t E l e m e n t B y I d ( r a d i o B u t t o n P r o d u c t B o x ) . c h e c k e d = t r u e ;  
             d o c u m e n t . g e t E l e m e n t B y I d ( t r P r o d u c t B o x C l i e n t I D ) . s t y l e . d i s p l a y = ' ' ;  
             d o c u m e n t . g e t E l e m e n t B y I d ( t r H t m l B o x C l i e n t I D ) . s t y l e . d i s p l a y = ' n o n e ' ;  
         }  
       }  
       m y M P E . h i d e ( ) ;  
 }  
  
 f u n c t i o n   V a l i d a t e U R L ( i n p u t V a l u e )  
 {  
         v a r   e x p   =   / ^ ( [ h H ] [ t T ] [ t T ] [ p P ] [ s S ] { 0 , 1 } ) : \ / \ / ( ( [ \ w \ - _ ] + ( \ . [ \ w \ - _ ] + ) + ( [ \ w \ s \ - \ . , @ ? ^ = % & a m p ; : / ~ \ + # ] * [ \ w \ s \ - \ @ ? ^ = % & a m p ; / ~ \ + # ] ) ) | ( [ \ w \ s ] * ) ) ? $ / ;  
           / / v a r   e x p = / ^ ( [ h H ] [ t T ] [ t T ] [ p P ] [ s S ] { 0 , 1 } ) : \ / \ / [ a - z A - Z 0 - 9 \ - \ . ] + \ . [ a - z A - Z ] { 2 , 3 } ( \ / \ S * ) ? $ / ;  
         v a r   r e g e x   =   n e w   R e g E x p ( e x p ) ;  
         v a r   r e s u l t = f a l s e ;  
         i f ( i n p u t V a l u e   = =   n u l l   | |   i n p u t V a l u e   = =   u n d e f i n e d   | |   t r i m ( i n p u t V a l u e )   = =   ' ' )  
         {  
                 r e s u l t   =   t r u e ;  
         }  
         e l s e  
         {  
                 r e s u l t   =   r e g e x . t e s t ( i n p u t V a l u e ) ;  
                 i f ( r e s u l t   = =   f a l s e )  
                 {  
                         a l e r t ( ' P l e a s e   e n t e r   v a l i d   U R L . ( E x a m p l e :   h t t p ( s ) : / / w w w . m n j t e c h . c o m ) ' ) ;  
                 }  
         }  
          
         i f ( r e s u l t   = =   t r u e   & &   t r i m ( i n p u t V a l u e )   ! =   ' ' )  
         {  
 	 	 v a r   p a r t s O f U R L   =   i n p u t V a l u e . s p l i t ( ' h t t p : / / ' ) ;  
 	 	 v a r   h t t p S t r i n g   =   ' h t t p : / / ' ;  
 	 	 i f ( i n p u t V a l u e . i n d e x O f ( h t t p S t r i n g )   > - 1   )  
 	 	 {  
 	 	 	 i f ( t r i m ( i n p u t V a l u e ) . l e n g t h   = =   h t t p S t r i n g . l e n g t h )  
 	 	 	 {  
 	 	 	 	 a l e r t ( ' P l e a s e   e n t e r   v a l i d   U R L . ( E x a m p l e :   h t t p ( s ) : / / w w w . m n j t e c h . c o m ) ' ) ;  
 	 	 	 	 r e s u l t   =     f a l s e ;  
 	 	 	 }  
 / / 	 	 	 e l s e   i f ( p a r t s O f U R L . l e n g t h   > 0   & &   r e s u l t   = =   t r u e )  
 / / 	 	 	 {  
 / / 	 	 	 	 v a r   u r l P a r t   =   ' w w w . ' ;  
 / / 	 	 	 	 i f ( p a r t s O f U R L [ 1 ] . i n d e x O f ( u r l P a r t )   >   - 1   & &   p a r t s O f U R L [ 1 ] . i n d e x O f ( u r l P a r t )   = =   0 )  
 / / 	 	 	 	 {  
 / / 	 	 	 	 	 v a r   u r l A f t e r P a r t   =   p a r t s O f U R L [ 1 ] . s u b s t r i n g ( u r l P a r t . l e n g t h , p a r t s O f U R L [ 1 ] . l e n g t h ) ;  
 / / 	 	 	 	 	 i f ( u r l A f t e r P a r t . i n d e x O f ( ' . ' )   <   0 )  
 / / 	 	 	 	 	 {  
 / / 	 	 	 	 	 	 r e s u l t   =   f a l s e ;  
 / / 	 	 	 	 	 }  
 / / 	 	 	 	 }  
 / / 	 	 	 }  
 	 	 }  
 	 	 v a r   h t t p s S t r i n g   =   ' h t t p s : / / ' ;  
 	 	  
 	 	 p a r t s O f U R L   =   i n p u t V a l u e . s p l i t ( ' h t t p s : / / ' ) ;  
 	 	 i f ( i n p u t V a l u e . i n d e x O f ( h t t p s S t r i n g )   > - 1 )  
 	 	 {  
 	 	 	 i f ( t r i m ( i n p u t V a l u e ) . l e n g t h   = =   h t t p s S t r i n g . l e n g t h )  
 	 	 	 {  
 	 	 	 	 a l e r t ( ' P l e a s e   e n t e r   v a l i d   U R L . ( E x a m p l e :   h t t p ( s ) : / / w w w . m n j t e c h . c o m ) ' ) ;  
 	 	 	 	 r e s u l t   =     f a l s e ;  
 	 	 	 }  
 / / 	 	 	 e l s e   i f ( p a r t s O f U R L . l e n g t h   > 0   & &   r e s u l t   = =   t r u e )  
 / / 	 	 	 {  
 / / 	 	 	 	 v a r   u r l P a r t   =   ' w w w . ' ;  
 / / 	 	 	 	 i f ( p a r t s O f U R L [ 1 ] . i n d e x O f ( u r l P a r t )   >   - 1   & &   p a r t s O f U R L [ 1 ] . i n d e x O f ( u r l P a r t )   = =   0 )  
 / / 	 	 	 	 {  
 / / 	 	 	 	 	 v a r   u r l A f t e r P a r t   =   p a r t s O f U R L [ 1 ] . s u b s t r i n g ( u r l P a r t . l e n g t h , p a r t s O f U R L [ 1 ] . l e n g t h ) ;  
 / / 	 	 	 	 	 i f ( u r l A f t e r P a r t . i n d e x O f ( ' . ' )   <   0 )  
 / / 	 	 	 	 	 {  
 / / 	 	 	 	 	 	 r e s u l t   =   f a l s e ;  
 / / 	 	 	 	 	 }  
 / / 	 	 	 	 }  
 / / 	 	 	 }  
 	 	 }  
         }  
          
         r e t u r n   r e s u l t ;  
 }  
  
 f u n c t i o n   m a k e h t m l ( t e x t )   {  
         v a r   t e x t n e u   =   t e x t . r e p l a c e ( e v a l ( ' / & / g ' ) , " & a m p ; " ) ;  
 / /         t e x t n e u   =   R e p l a c e A l l ( t e x t , / < / , " & l t ; " ) ;  
 / /         t e x t n e u   =   R e p l a c e A l l ( t e x t , / > / , " & g t ; " ) ;  
 / /         t e x t n e u   =   R e p l a c e A l l ( t e x t , / \ r \ n / , " < b r > " ) ;  
 / /         t e x t n e u   =   R e p l a c e A l l ( t e x t , / \ n / , " < b r > " ) ;  
 / /         t e x t n e u   =   R e p l a c e A l l ( t e x t , / \ r / , " < b r > " ) ;  
         r e t u r n ( t e x t n e u ) ;  
 }  
  
 f u n c t i o n   R e p l a c e A l l ( S o u r c e , s t r i n g T o F i n d , s t r i n g T o R e p l a c e ) {  
  
     v a r   t e m p   =   S o u r c e ;  
  
         v a r   i n d e x   =   t e m p . i n d e x O f ( s t r i n g T o F i n d ) ;  
  
                 w h i l e ( i n d e x   ! =   - 1 ) {  
  
                         t e m p   =   t e m p . r e p l a c e ( s t r i n g T o F i n d , s t r i n g T o R e p l a c e ) ;  
  
                         i n d e x   =   t e m p . i n d e x O f ( s t r i n g T o F i n d ) ;  
  
                 }  
  
                 r e t u r n   t e m p ;  
  
 }  
  
 f u n c t i o n   r e p l a c e E x t C h a r s ( t e x t , o u t p u t )   {  
 t e x t   =   t e x t . r e p l a c e ( e v a l ( ' / & / g ' ) ,   ' & a m p ; ' ) ;  
 f r o m T o   =   n e w   A r r a y ( ' & A E l i g ; ' , ' Æ ' , ' & A a c u t e ; ' , ' Á ' , ' & A c i r c ; ' , ' Â ' , '   & A g r a v e ; ' , ' À ' , ' & A r i n g ; ' , ' Å ' , ' & A t i l d e ; ' , ' Ã ' , ' & A u m l ;   ' , ' Ä ' , ' & C c e d i l ; ' , ' Ç ' , ' & E T H ; ' , ' Ð ' , ' & E a c u t e ; ' , ' É ' , ' &   E c i r c ; ' , ' Ê ' , ' & E g r a v e ; ' , ' È ' , ' & E u m l ; ' , ' Ë ' , ' & I a c u t e ; '   , ' Í ' , ' & I c i r c ; ' , ' Î ' , ' & I g r a v e ; ' , ' Ì ' , ' & I u m l ; ' , ' Ï ' , ' & N   t i l d e ; ' , ' Ñ ' , ' & O a c u t e ; ' , ' Ó ' , ' & O c i r c ; ' , ' Ô ' , ' & O g r a v e ;   ' , ' Ò ' , ' & O s l a s h ; ' , ' Ø ' , ' & O t i l d e ; ' , ' Õ ' , ' & O u m l ; ' , ' Ö ' , '   & T H O R N ; ' , ' Þ ' , ' & U a c u t e ; ' , ' Ú ' , ' & U c i r c ; ' , ' Û ' , ' & U g r a v e   ; ' , ' Ù ' , ' & U u m l ; ' , ' Ü ' , ' & Y a c u t e ; ' , ' Ý ' , ' & a a c u t e ; ' , ' á ' ,   ' & a c i r c ; ' , ' â ' , ' & a e l i g ; ' , ' æ ' , ' & a g r a v e ; ' , ' à ' , ' & a r i n g   ; ' , ' å ' , ' & a t i l d e ; ' , ' ã ' , ' & a u m l ; ' , ' ä ' , ' & b r v b a r ; ' , ' ¦ ' ,   ' & c c e d i l ; ' , ' ç ' , ' & c e n t ; ' , ' ¢ ' , ' & c o p y ; ' , ' © ' , ' & d e g ; ' , '   ° ' , ' & e a c u t e ; ' , ' é ' , ' & e c i r c ; ' , ' ê ' , ' & e g r a v e ; ' , ' è ' , ' & e   t h ; ' , ' ð ' , ' & e u m l ; ' , ' ë ' , ' & f r a c 1 2 ; ' , ' ½ ' , ' & f r a c 1 4 ; ' , ' ¼   ' , ' & f r a c 3 4 ; ' , ' ¾ ' , ' & g t ; ' , ' > ' , ' & g t ' , ' > ' , ' & i a c u t e ; ' , '   í ' , ' & i c i r c ; ' , ' î ' , ' & i e x c l ; ' , ' ¡ ' , ' & i g r a v e ; ' , ' ì ' , ' & i q   u e s t ; ' , ' ¿ ' , ' & i u m l ; ' , ' ï ' , ' & l a q u o ; ' , ' « ' , ' & l t ; ' , ' < ' , '   & l t ' , ' < ' , ' & m d a s h ; ' , '  ' , ' & m i c r o ; ' , ' µ ' , ' & m i d d o t ; ' , ' ·   ' , ' & n d a s h ; ' , '  ' , ' & n o t ; ' , ' ¬ ' , ' & n t i l d e ; ' , ' ñ ' , ' & o a c u t   e ; ' , ' ó ' , ' & o c i r c ; ' , ' ô ' , ' & o g r a v e ; ' , ' ò ' ,  
 ' & o s l a s h ; ' , ' ø ' , ' & o t i l d e ; ' , ' õ ' , ' & o u m l ; ' , ' ö ' , ' & p a r a ; ' ,   ' ¶ ' , ' & p l u s m n ; ' , ' ± ' , ' & p o u n d ; ' , ' £ ' , ' & q u o t ; ' , ' \ " ' , ' & r   a q u o ; ' , ' » ' , ' & r e g ; ' , ' ® ' , ' & s e c t ; ' , ' § ' , ' ­ ' , ' * ' , ' & s u p 1   ; ' , ' ¹ ' , ' & s u p 2 ; ' , ' ² ' , ' & s u p 3 ; ' , ' ³ ' , ' & s z l i g ; ' , ' ß ' , ' & t   h o r n ; ' , ' þ ' , ' & t i l d e ; ' , ' Ü' , ' & t r a d e ; ' , ' "!' , ' & u a c u t e ; ' ,   ' ú ' , ' & u c i r c ; ' , ' û ' , ' & u g r a v e ; ' , ' ù ' , ' & u u m l ; ' , ' ü ' , ' & y a   c u t e ; ' , ' ý ' , ' & y e n ; ' , ' ¥ ' , ' & y u m l ; ' , ' ÿ ' ) ;  
  
 i f   ( o u t p u t )   {  
 f r o m T o [ f r o m T o . l e n g t h ]   =   ' & a m p ; ' ;  
 f r o m T o [ f r o m T o . l e n g t h ]   =   ' & ' ;  
 }  
 f o r   ( i = 0 ;   i   <   f r o m T o . l e n g t h ;   i = i + 2 )  
 t e x t   =   t e x t . r e p l a c e ( e v a l ( ' / ' + f r o m T o [ i + 1 ] + ' / g ' ) ,   f r o m T o [ i ] )  
 r e t u r n   ( t e x t ) ;  
 }  
  
 f u n c t i o n   S e t V e n d o r B o x F o r m a t ( r d o H T M L B o x , r d o P r o d u c t B o x , t r C o n f i g u r e H T M L B o x , t r C o n f i g u r e P r o d u c t B o x )  
 {  
  
 	 v a r   o b j R d o H T M L 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 ( r d o H T M L B o x ) ;  
 	 v a r   o b j R d o P r o d u c t 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 ( r d o P r o d u c t B o x ) ;  
 	 v a r   o b j T r C o n f i g u r e H T M L 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 ( t r C o n f i g u r e H T M L B o x ) ;  
 	 v a r   o b j T r C o n f i g u r e P r o d u c t 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 ( t r C o n f i g u r e P r o d u c t B o x ) ;  
 	 i f ( o b j R d o H T M L B o x   ! =   n u l l   & &   o b j R d o P r o d u c t B o x   ! =   n u l l   & &   o b j T r C o n f i g u r e H T M L B o x   ! =   n u l l   & &   o b j T r C o n f i g u r e P r o d u c t B o x   ! =   n u l l )  
 	 {  
 	 	 o b j T r C o n f i g u r e H T M L B o x . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 o b j T r C o n f i g u r e P r o d u c t B o x . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	  
 	 	 i f ( o b j R d o H T M L B o x . c h e c k e d )  
 	 	 {  
 	 	         o b j R d o H T M L B o x . c h e c k e d = t r u e ;        
 	 	 	 o b j T r C o n f i g u r e H T M L B o x . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	       o b j R d o P r o d u c t B o x . c h e c k e d = t r u e ;  
 	 	 	 o b j T r C o n f i g u r e P r o d u c t B o x . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   o n d d l S e l e c t A g e n c y ( d d l B r a n d s )  
       {  
       	 i f   ( d d l B r a n d s   ! =   n u l l )  
       	 {  
  
       	 	 v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " S e t A g e n c i e s = "   +   d d l B r a n d s . v a l u e   +   " | | | "   +   d d l B r a n d s . o p t i o n s [ d d l B r a n d s . s e l e c t e d I n d e x ] . t e x t ;   v a r   r e s u l t   =   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;  
       	 	 l o c a t i o n . h r e f   =   l o c a t i o n . h r e f ;  
       	   }  
       	 }  
  
       	 f u n c t i o n   o n S e t A g e n c y C o o k i e ( c h e c k S e t A s H o m e P a g e , r o w S e l e c t A g e n c y I d )  
       	 {  
       	 	 i f   ( c h e c k S e t A s H o m e P a g e   ! =   n u l l )  
       	 	 {  
  
       	 	 	 v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   q S t r i n g   =   " S e t A g e n c y C o o k i e s = "   +   c h e c k S e t A s H o m e P a g e . c h e c k e d . t o S t r i n g ( ) ;    
       	 	 	 v a r   r e s u l t   =   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;  
       	 	 	 / / l o c a t i o n . h r e f   =   l o c a t i o n . h r e f ;  
       	 	 	 v a r   r o w S e l e c t A g e n c y   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w S e l e c t A g e n c y I d ) ;  
       	 	 	 i f ( r o w S e l e c t A g e n c y   ! =   n u l l )  
       	 	 	 {  
       	 	 	 	 i f ( c h e c k S e t A s H o m e P a g e . c h e c k e d )  
       	 	 	 	 {  
       	 	 	 	 	 r o w S e l e c t A g e n c y . s t y l e . d i s p l a y   =   ' n o n e ' ;  
       	 	 	 	 }  
       	 	 	 	 e l s e  
       	 	 	 	 {  
       	 	 	 	 	 r o w S e l e c t A g e n c y . s t y l e . d i s p l a y   =   ' ' ;  
       	 	 	 	 }  
       	 	 	 }  
       	 	 }  
       	 }  
       	  
       	 f u n c t i o n   S e t T o p L e v e l A g e n c i e s ( E m a i l T e x t B o x I d , I s C o n t r a c t E n a b l e d , d r o p D o w n A g e n c y L e v e l 1 I d , d r o p D o w n A g e n c y L e v e l 2 I d , d r o p D o w n A g e n c y L e v e l 3 I d , d r o p D o w n A g e n c y L e v e l 4 I d , d r o p D o w n A g e n c y L e v e l 5 I d , I s I n d e x C h a n g e d A g e n c y L e v e l 1 , I s I n d e x C h a n g e d A g e n c y L e v e l 2 , I s I n d e x C h a n g e d A g e n c y L e v e l 3 , I s I n d e x C h a n g e d A g e n c y L e v e l 4 , I s I n d e x C h a n g e d A g e n c y L e v e l 5 )  
       	 {  
       	 	 i f ( I s C o n t r a c t E n a b l e d )  
       	 	 {  
       	 	 	 v a r   E m a i l T e x t 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 ( E m a i l T e x t B o x I d ) ;  
       	 	 	 v a r   d r o p D o w n A g e n c y L e v e l 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( d r o p D o w n A g e n c y L e v e l 1 I d ) ;  
       	 	 	 v a r   d r o p D o w n A g e n c y L e v e l 2   =   d o c u m e n t . g e t E l e m e n t B y I d ( d r o p D o w n A g e n c y L e v e l 2 I d ) ;  
       	 	 	 v a r   d r o p D o w n A g e n c y L e v e l 3   =   d o c u m e n t . g e t E l e m e n t B y I d ( d r o p D o w n A g e n c y L e v e l 3 I d ) ;  
       	 	 	 v a r   d r o p D o w n A g e n c y L e v e l 4   =   d o c u m e n t . g e t E l e m e n t B y I d ( d r o p D o w n A g e n c y L e v e l 4 I d ) ;  
       	 	 	 v a r   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( I s I n d e x C h a n g e d A g e n c y L e v e l 1 ) ;  
       	 	 	 v a r   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 2   =   d o c u m e n t . g e t E l e m e n t B y I d ( I s I n d e x C h a n g e d A g e n c y L e v e l 2 ) ;  
       	 	 	 v a r   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 3 =   d o c u m e n t . g e t E l e m e n t B y I d ( I s I n d e x C h a n g e d A g e n c y L e v e l 3 ) ;  
       	 	 	 v a r   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 4   =   d o c u m e n t . g e t E l e m e n t B y I d ( I s I n d e x C h a n g e d A g e n c y L e v e l 4 ) ;  
       	 	 	 v a r   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 5   =   d o c u m e n t . g e t E l e m e n t B y I d ( I s I n d e x C h a n g e d A g e n c y L e v e l 5 ) ;  
       	 	 	  
       	 	 	 v a r   d r o p D o w n A g e n c y L e v e l 5   =   d o c u m e n t . g e t E l e m e n t B y I d ( d r o p D o w n A g e n c y L e v e l 5 I d ) ;  
       	 	 	  
 	 	 	 v a r   i s F i r e F o x B r o w s e r   =   f a l s e ;   i f   ( d o c u m e n t . a l l )   {   i s F i r e F o x B r o w s e r   =   f a l s e   }   e l s 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 )   {   i s F i r e F o x B r o w s e r   =   t r u e   }   }   f u n c t i o n   G e t R e s u l t ( b ,   d )   {   v a r   c   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;   v a r   a   =   " S e a r c h C o n t e x t = "   +   b   +   " & V a l u e = "   +   d ;   r e t u r n   A s y n c P o s t _ D a t a ( c ,   a ,   U p d a t e R e s u l t )   }   f u n c t i o n   G e t C o n t e x t ( a )   {   s w i t c h   ( a . s e l e c t e d I n d e x )   {   c a s e   0 :   r e t u r n   1 ;   b r e a k ;   c a s e   1 :   r e t u r n   3 ;   b r e a k ;   c a s e   2 :   r e t u r n   4 ;   b r e a k ;   c a s e   3 :   r e t u r n   2 ;   b r e a k   }   }  
       	 	 	  
       	 	 	 i f ( E m a i l T e x t B o x   ! =   n u l l   & &   t r i m ( E m a i l T e x t B o x . v a l u e )   ! =   ' '   & &   d r o p D o w n A g e n c y L e v e l 1   ! =   n u l l   & &   d r o p D o w n A g e n c y L e v e l 2   ! =   n u l l  
       	 	 	 	 & &   d r o p D o w n A g e n c y L e v e l 3   ! =   n u l l   & &   d r o p D o w n A g e n c y L e v e l 4   ! =   n u l l   & &   d r o p D o w n A g e n c y L e v e l 5   ! =   n u l l )  
 	 	 	 {  
 	 	 	 	 v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;    
 	 	 	 	 v a r   q S t r i n g   =   " F e t c h A g e n c y D o m a i n R e a l t i o n = "   +   E m a i l T e x t B o x . v a l u e ;    
       	 	 	 	 v a r   r e s u l t   =   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;  
       	 	 	 	 i f ( r e s u l t   ! =   n u l l   & &   r e s u l t   ! =   u n d e f i n e d   & &   r e s u l t   ! =   ' ' )  
       	 	 	 	 {  
       	 	 	 	  
       	 	 	 	 	   v a r   e   =   d r o p D o w n A g e n c y L e v e l 2 . c h i l d N o d e s . l e n g t h ;    
       	 	 	 	 	   f o r   ( v a r   d   =   0 ;   d   <   e ;   d + + )   {  
 	 	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 2 . r e m o v e ( 0 )  
 	 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 	 v a r   a g e n c i e s   =   r e s u l t . s p l i t ( ' , ' ) ;  
 	 	 	 	 	 i f ( a g e n c i e s   ! =   n u l l )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 f o r   ( v a r   a   =   0 ;   a   <   a g e n c i e s . l e n g t h ;   a + + )   {  
 	 	 	 	 	 	 i f ( a   = =   0 )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 v a r   g   =   d o c u m e n t . c r e a t e E l e m e n t ( " O P T I O N " ) ;  
 	 	 	 	 	 	 	 g . t e x t   =   ' - - s e l e c t - - ' ;   g . v a l u e   =   " - 1 " ;  
 	 	 	 	 	 	 	 i f   ( i s F i r e F o x B r o w s e r )   {  
 	 	 	 	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 2 . o p t i o n s [ a ]   =   g  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 2 . a d d ( g )  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 v a r   c   =   a g e n c i e s [ a ] . s p l i t ( " | | | " ) ;  
 	 	 	 	 	 	 	 v a r   g   =   d o c u m e n t . c r e a t e E l e m e n t ( " O P T I O N " ) ;  
 	 	 	 	 	 	 	 g . t e x t   =   c [ 1 ] ;   g . v a l u e   =   c [ 0 ] ;  
 	 	 	 	 	 	 	 i f   ( i s F i r e F o x B r o w s e r )   {  
 	 	 	 	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 2 . o p t i o n s [ a ]   =   g  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 2 . a d d ( g )  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 1 . v a l u e   =   a g e n c i e s [ 0 ] ;  
 	 	 	 	 	 	  
 	 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 	   i f ( o b j I s I n d e x C h a n g e d A g e n c y L e v e l 1   ! =   n u l l   & &   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 2   ! =   n u l l    
 	 	 	 	 	 	 	   & &   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 3   ! =   n u l l     & &   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 4   ! =   n u l l     & &   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 5   ! =   n u l l )  
 	 	 	 	 	   {  
 	 	 	 	 	 	   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 1 . v a l u e   =   " 1 " ;  
 / / 	 	 	 	 	 	   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 2 . v a l u e   =   " 1 " ;  
 / / 	 	 	 	 	 	   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 3 . v a l u e   =   " 1 " ;  
 / / 	 	 	 	 	 	   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 4 . v a l u e   =   " 1 " ;  
 / / 	 	 	 	 	 	   o b j I s I n d e x C h a n g e d A g e n c y L e v e l 5 . v a l u e   =   " 1 " ;  
 	 	 	 	 	   }  
       	 	 	 	 	  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 2 . v a l u e   =   " - 1 " ;  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 3 . v a l u e   =   " - 1 " ;  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 4 . v a l u e   = " - 1 " ;  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 5 . v a l u e   =   " - 1 " ;  
       	 	 	 	 	  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 1 . d i s a b l e d   =   f a l s e ;  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 2 . d i s a b l e d   =   f a l s e ;  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 3 . d i s a b l e d   =   t r u e ;  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 4 . d i s a b l e d   =   t r u e ;  
       	 	 	 	 	 d r o p D o w n A g e n c y L e v e l 5 . d i s a b l e d   =   t r u e ;  
       	 	 	 	 	  
       	 	 	 	 }  
 	 	 	 }  
       	 	 }  
       	 }  
       	  
       	 f u n c t i o n   S e t T o o l T i p F o r d r o p D o w n ( d r o p D o w n )  
       	 {  
       	 	 i f ( d r o p D o w n   ! =   n u l l   & &   d r o p D o w n . o p t i o n s   ! =   n u l l   & &   d r o p D o w n . o p t i o n s . l e n g t h   > 0 )  
       	 	 {  
       	 	 	 d r o p D o w n . t i t l e   =   d r o p D o w n . o p t i o n s [ d r o p D o w n . s e l e c t e d I n d e x ] . t e x t  
       	 	 	   v a r   i n d e x = 0 ;  
       	 	 	 f o r ( i n d e x   = 0 ; i n d e x < d r o p D o w n . o p t i o n s . l e n g t h   ; i n d e x + + )  
       	 	 	 {  
       	 	 	 	 d r o p D o w n . o p t i o n s [ i n d e x ] . t i t l e   = 	     d r o p D o w n . o p t i o n s [ i n d e x ] . t e x t ;  
       	 	 	 }  
       	 	 }  
       	 	 r e t u r n   f a l s e ;  
       	 }  
       	  
       	  
       	  
       	 f u n c t i o n   S e t F o c u s f o r C o n t r o l ( t x t U s e r n a m e , t x t P a s s w o r d I D )  
       	 {  
       	 	 v a r   t x t P a s s w o r d   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t P a s s w o r d I D ) ;  
       	 	  
       	 	 i f ( 	 t x t U s e r n a m e   ! =   n u l l   & &   t x t P a s s w o r d   ! =   n u l l )  
       	 	 {  
       	 	 	 t r y  
       	 	 	 {  
       	 	 	 	 t x t P a s s w o r d . f o c u s ( ) ;  
       	 	 	 	  
       	 	 	 }  
       	 	 	  
       	 	 	 c a t c h   ( e r r )   {  
       	 	 	 }  
       	 	 }  
       	 }  
       	  
       	  
       	  
       	 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m a n u f a c t u r e r   l o g o   f u n c t i o n s - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
       	  
       	  
       	 f u n c t i o n   P r e v i e w M a n u f a c t u r e r L o g o ( f c k C l i e n t I D ,   t d P r e v i e w I D ,   t x t T i t l e C l i e n t I D ,   l b l P r e v i e w T i t l e C l i e n t I D ,   m p e P r e v i e w C l i e n t I D ,   b u t t o n I D T o B e D i s a b l e d ,   s e p e r a t o r F o r I D s ,   i s t o B e D i s a b l e d , h t m l T e x t A r e a I D , t r H T M L B o x P r e v i e w C l i e n t I D , t e s t , t e s t 2 )   {  
 	 	 	 v a r   m p e P r e v i e w   =   $ f i n d ( m p e P r e v i e w C l i e n t I D ) ;  
 	  
 	 	 	 i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0   & &   t d P r e v i e w I D   ! =   n u l l )   {  
 	 	 	 	 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
 	 	 	 	 v a r   H T M L T e x t   =   ' ' ;  
 	 	 	 	 v a r   t i t l e   =   ' ' ;  
 	 	 	 	 v a r   t d P r e v i e w   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d P r e v i e w I D ) ;  
 	 	 	 	 v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e C l i e n t I D ) ;  
 	 	 	 	 v a r   l b l P r e v i e w T i t l e   =   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 P r e v i e w T i t l e C l i e n t I D ) ;  
 	 	                  
 	 	 	 	 i f   ( m p e P r e v i e w   ! =   n u l l )   {  
 	 	 	 	 	 m p e P r e v i e w . h i d e ( ) ;  
 	 	 	 	 }  
 	 	 	 	 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l P r e v i e w T i t l e   ! =   n u l l )   {  
 	 	 	 	 	 t i t l e   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 i f   ( t i t l e   = =   ' ' )   {  
 	 	 	 	 	 	 a l e r t ( ' T i t l e   i s   r e q u i r e d . ' ) ;  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 i f   ( o E d i t o r   ! =   n u l l   & &   t d P r e v i e w   ! =   n u l l )   {  
 	 	 	 	 	 H T M L T e x t   =   o E d i t o r . G e t H T M L ( ) ;  
 	 	 	 	 	 i f   ( H T M L T e x t   = =   u n d e f i n e d   | |   H T M L T e x t   = =   n u l l   | |   t r i m ( H T M L T e x t )   = =   ' ' )   {  
 	 	 	 	 	 	 a l e r t ( ' M a n u f a c t u r e r   l o g o   D e s c r i p t i o n   i s   r e q u i r e d . ' ) ;  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 }  
 	 	                  
 	 	 	 	 }  
 	 	                  
 	  
 	 	                  
 	 	 	 	 D i s a b l e B u t t o n s ( b u t t o n I D T o B e D i s a b l e d ,   s e p e r a t o r F o r I D s ,   i s t o B e D i s a b l e d ,   m p e P r e v i e w C l i e n t I D ) ;  
 	 	 	 	   t r y  
 	 	 	 	 	 {  
 	 	 	 	 	 	 / / t d P r e v i e w . i n n e r H T M L   =     ' < a s p : L i t e r a l   I D = " l i t H T M L P r e v i e w C o n t e n t 1 2 "   r u n a t = " s e r v e r " > '   +   H T M L T e x t + ' < / a s p : L i t e r a l > '   ;  
 	 	 	 	 	 	 t d P r e v i e w . i n n e r H T M L   =         H T M L T e x t   ;  
 	 	 	 	 	 }  
 	 	 	 	 	   c a t c h   ( e r r ) { }  
 	 	 	 	 / / t d P r e v i e w . i n n e r H T M L   =     H T M L T e x t ;  
 	 	 	 	 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l P r e v i e w T i t l e   ! =   n u l l )   {  
 	 	 	 	 	 i f   ( i s f i r e F o x B r o w s e r )   {  
 	 	 	 	 	 	 l b l P r e v i e w T i t l e . t e x t C o n t e n t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 l b l P r e v i e w T i t l e . i n n e r T e x t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
 	 	 	 	 	 }  
 	 	                          
 	 	 	 	 }  
 	 	 	 	 i f   ( m p e P r e v i e w   ! =   n u l l )   {  
 	 	 	 	 	 m p e P r e v i e w . s h o w ( ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	  
         r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   S a v e M a n u f a c t u r e r L o g o ( P a g e I d ,   C o n t r o l I d , I s A g e n c y G r o u p , A g e n c y I d ,   f c k C l i e n t I D ,   t x t U R L I D , t d I D , l i n k M a n u f a c t u r e r L o g o I d ,   m p e I D ,   t x t T i t l e C l i e n t I D ,   l b l T i t l e C l i e n t I D , h t m l T e x t A r e a I D , t d H T M L C o n t e n t I D , h i d d e n M a n u f a c t u r e r L i n k I d , r a d i o H i d e I d , r a d i o S h o w I d , c e l l H T M L C o n t e n t I D )   {  
         i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0   & &   t d I D   ! =   n u l l )   {  
                 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
                 v a r   H T M L T e x t   =   ' ' ;  
                 v a r   t i t l e   =   ' ' ;  
                 v a r   t d   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d I D ) ;  
                 v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e C l i e n t I D ) ;  
                 v a r   l b l T i t l e   =   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 T i t l e C l i e n t I D ) ;  
                 v a r   l i n k M a n u f a c t u r e r L o g o   =   d o c u m e n t . g e t E l e m e n t B y I d ( l i n k M a n u f a c t u r e r L o g o I d ) ;  
                 v a r   h i d d e n M a n u f a c t u r e r L i n k   =   d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n M a n u f a c t u r e r L i n k I d ) ;  
                 v a r   r a d i o H i d e   =   d o c u m e n t . g e t E l e m e n t B y I d ( r a d i o H i d e I d ) ;      
                 v a r   r a d i o S h o w   =   d o c u m e n t . g e t E l e m e n t B y I d ( r a d i o S h o w I d ) ;  
                 v a r   c e l l H T M L C o n t e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( c e l l H T M L C o n t e n t I D ) ;  
                  
                 v a r   t x t U R L   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t U R L I D ) ;  
 	 	   v a r   U R L   = ' ' ;  
 	 	    
                 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l T i t l e   ! =   n u l l )   {  
                         t i t l e   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                         i f   ( t i t l e   = =   ' ' )   {  
                                 a l e r t ( ' T i t l e   i s   r e q u i r e d . ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
                 }  
                  
                  
                 i f   ( o E d i t o r   ! =   n u l l   & &   t d   ! =   n u l l )   {  
                         H T M L T e x t   =   o E d i t o r . G e t H T M L ( ) ;  
                         i f   ( H T M L T e x t   = =   u n d e f i n e d   | |   H T M L T e x t   = =   n u l l   | |   t r i m ( H T M L T e x t )   = =   ' ' )   {  
                                 a l e r t ( ' M a n u f a c t u r e r   L o g o   T e x t   i s   r e q u i r e d . ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
                 }  
                  
                 i f ( t x t U R L   ! =   n u l l )  
 	 	   {  
 	 	    
 	 	 	 U R L   =   t r i m ( t x t U R L . v a l u e ) ;  
 	 	 	   i f   ( U R L   = =   ' ' )   {  
                                 a l e r t ( ' U R L   i s   r e q u i r e d . ' ) ;  
                                 r e t u r n   f a l s e ;       }  
                                  
                       i f ( V a l i d a t e U R L ( U R L )   = =   f a l s e )  
                       {  
 	 	 	 	 r e t u r n   f a l s e ;  
                       }  
 	 	 	  
 	 	   }  
                  
 / /                 v a r   H T M L T e x t 1   =   H T M L T e x t ;  
 / /                 H T M L T e x t 1   =   R e p l a c e A l l ( H T M L T e x t , ' + ' , ' # # # # # ' ) ;  
 / /                  
 / /                   H T M L T e x t 1   =   R e p l a c e A l l ( H T M L T e x t 1 , ' & ' , ' @ @ @ @ @ ' ) ;  
 / /                 / / H T M L T e x t 1   =   H T M L T e x t . r e p l a c e ( e v a l ( ' / & / g ' ) , ' # # # # # ' ) ;  
 / /                 H T M L T e x t 1   =   e n c o d e U R I C o m p o n e n t ( H T M L T e x t 1 ) ;  
 / /                  
 / /                   U R L   =   R e p l a c e A l l ( U R L , ' & ' , ' @ @ @ @ @ ' ) ;  
 / / 	 	     v a r   i s H i d d e n   =   f a l s e ;  
 / /                   i f ( r a d i o H i d e   ! =   n u l l   & &   r a d i o S h o w   ! =   n u l l )  
 / / 	 	 {  
 / / 	 	 	 i s H i d d e n =   r a d i o H i d e . c h e c k e d  
 / / 	 	 }  
 / /                  
 / /                 / / H T M L T e x t = r e p l a c e E x t C h a r s ( H T M L T e x t , t r u e ) ;  
 / /                 v a r   r e s u l t   =   D o A j a x C a l l F o r M a n u f a c t u r e r L o g o ( P a g e I d ,   C o n t r o l I d , I s A g e n c y G r o u p , A g e n c y I d , H T M L T e x t 1 , U R L , i s H i d d e n ) ;  
 / /                 / / v a r   r e s u l t   = ' 1 2 ' ;  
  
 	 	 	 v a r   r e s u l t   =   1 ;  
                 i f   ( r e s u l t   = =   0 )   {  
                         a l e r t ( ' T h e r e   w a s   s o m e   e r r o r   i n   s a v i n g   d a t a . ' ) ;  
                 }  
                 e l s e   {  
                         t r y  
                         {  
                                 / / t d . i n n e r H T M L   =     ' < a s p : L i t e r a l   I D = " l i t H T M L P r e v i e w C o n t e n t "   r u n a t = " s e r v e r " > '   +   H T M L T e x t + ' < / a s p : L i t e r a l > '   ;  
                                 t d . i n n e r H T M L   =     H T M L T e x t   ;  
                         }  
                           c a t c h   ( e r r ) { }  
  
                         t d . s t y l e . h e i g h t   =   " a u t o " ;  
                         i f   ( t d . p a r e n t N o d e   ! =   n u l l )   {  
                                 t d . p a r e n t N o d e . s t y l e . h e i g h t   =   " a u t o " ;  
                         }  
                         i f   ( t x t T i t l e   ! =   n u l l   & &   l b l T i t l e   ! =   n u l l )   {  
                                 i f   ( ! i s f i r e F o x B r o w s e r )   {  
                                         l b l T i t l e . i n n e r T e x t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                                 }  
                                 e l s e   {  
                                         l b l T i t l e . t e x t C o n t e n t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                                 }  
                         }  
                          
                         i f ( l i n k M a n u f a c t u r e r L o g o   ! =   n u l l )  
                         {  
 	 	 	 	  
 	 	 	 	 v a r   t e m p U R L     =   R e p l a c e A l l ( U R L , ' @ @ @ @ @ ' , ' & ' ) ;  
 	 	 	 	     h i d d e n M a n u f a c t u r e r L i n k . v a l u e   =   t e m p U R L ;  
 	 	 	 	 / / v a r   o l d H R E F   =       l i n k M a n u f a c t u r e r L o g o . h r e f ;  
 	 	 	 	  
 	 	 	 	 / / l i n k M a n u f a c t u r e r L o g o . h r e f =   t e m p U R L ;  
 	 	 	 	 / / t d . h r e f =   t e m p U R L ;  
 	 	 	 	 / / l i n k M a n u f a c t u r e r L o g o . c l i c k (   ) ;  
 	 	 	 	  
 	 	 	 	 / / l i n k M a n u f a c t u r e r L o g o . c l i c k   =   f u n c t i o n    
 	 	 	 	 / / l i n k M a n u f a c t u r e r L o g o . o n c l i c k   =   " j a v a s c r i p t : l o c a t i o n . h r e f = ( ' "   +   t e m p U R L   +   " ' ) ;   r e t u r n   f a l s e ; " ;   / /   " M A n u f a c t u r e r L o g o C l i c k ( "   +   t e m p U R L   +   " ) " ;  
 	 	 	 	  
 / / 	 	 	 	 v a r   t d H T M L C o n t e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d H T M L C o n t e n t I D ) ;  
 / / 	 	 	 	 i f ( t d H T M L C o n t e n t   ! =   n u l l )  
 / / 	 	 	 	 {  
 / / 	 	 	 	 	 v a r   h t m l T e x t T D =   t d H T M L C o n t e n t . i n n e r H T M L ;  
 / / 	 	 	 	 	 t d H T M L C o n t e n t . i n n e r H T M L = ' ' ;  
 / / 	 	 	 	 	   h t m l T e x t T D   = 	 h t m l T e x t T D . r e p l a c e ( 	 o l d H R E F ,   t e m p U R L ) ;  
 / / 	 	 	 	 	   t d H T M L C o n t e n t . i n n e r H T M L =     h t m l T e x t T D ;  
 / / 	 	 	 	 }  
                         }  
                          
                         i f ( c e l l H T M L C o n t e n t   ! =   n u l l   & &   r a d i o H i d e   ! =   n u l l   & &   r a d i o S h o w   ! =   n u l l )  
 	 	 	 {  
 	 	 	 	 i f ( r a d i o H i d e . c h e c k e d )  
 	 	 	 	 {  
 	 	 	 	 	 c e l l H T M L C o n t e n t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 c e l l H T M L C o n t e n t . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	 	 }  
 	 	 	 }  
                          
                         v a r   m p e   =   $ f i n d ( m p e I D ) ;  
                         i f   ( m p e   ! =   n u l l )  
                         {   m p e . h i d e ( ) ;   }  
                 }  
  
         }  
         r e t u r n   t r u e ;  
 }  
  
 / / f u n c t i o n   M a n u f a c t u r e r L o g o C l i c k ( t x t U R L I D )  
 / /       	 {  
 / /       	 	 v a r   t x t U R L   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t U R L I D ) ;  
  
 / /       	 	 i f   ( t x t U R L   ! =   n u l l )  
 / /       	 	 {  
 / /       	 	 	 w i n d o w . l o c a t i o n . h r e f   =   t x t U R L . v a l u e ;  
 / /       	 	 }  
 / /       	 }  
  
 / / f u n c t i o n   M a n u f a c t u r e r E v e n t ( )  
 / /   {  
 / /   " l o c a t i o n . h r e f   = ' "   +   t e m p U R L   +   " ' "   ; r e t u r n   f a l s e ;  
 / /     }  
  
 / / S a v e M a n u f a c t u r e r L o g o ( ' H o m e ' , ' M L L e f t 1 ' , ' F a l s e ' , ' - 1 ' , ' c t l 0 0 _ u x M N J D e f a u l t C o n t e n t P l a c e H o l d e r _ U C M a n u f a c t u r e r L o g o 1 _ f c k D e s c r i p t i o n ' , ' c t l 0 0 _ u x M N J D e f a u l t C o n t e n t P l a c e H o l d e r _ U C M a n u f a c t u r e r L o g o 1 _ t x t U R L _ t x t D a t a ' , ' c t l 0 0 _ u x M N J D e f a u l t C o n t e n t P l a c e H o l d e r _ U C M a n u f a c t u r e r L o g o 1 _ d i v H T M L c o n t e n t ' , ' c t l 0 0 _ u x M N J D e f a u l t C o n t e n t P l a c e H o l d e r _ U C M a n u f a c t u r e r L o g o 1 _ l i n k M a n u f a c t u r e r L o g o ' , ' c t l 0 0 _ u x M N J D e f a u l t C o n t e n t P l a c e H o l d e r _ U C M a n u f a c t u r e r L o g o 1 _ m y M P E ' , ' ' , ' ' , ' c t l 0 0 _ u x M N J D e f a u l t C o n t e n t P l a c e H o l d e r _ U C M a n u f a c t u r e r L o g o 1 _ d i v T e m p H T M L ' ) ;  
 f u n c t i o n   D o A j a x C a l l F o r M a n u f a c t u r e r L o g o ( P a g e I d ,   C o n t r o l I d , I s A g e n c y G r o u p , A g e n c y I d , H T M L T e x t 1 , U R L , i s H i d d e n )   {  
         v a r   r e q u e s t U R L   =   " . . / . . / U I / C o m m o n / A j a x C a l l . a s p x " ;  
         v a r   q S t r i n g   =   " M a n u f a c t u r e r L o g o = "   +   P a g e I d   +   ' | | | | | '   +   C o n t r o l I d   +   ' | | | | | '   +   I s A g e n c y G r o u p   +   ' | | | | | '   +   A g e n c y I d   +   ' | | | | | '   +   H T M L T e x t 1   +   ' | | | | | '   +   U R L   +   ' | | | | | '   +   i s H i d d e n ;  
         r e t u r n   P o s t _ D a t a ( r e q u e s t U R L ,   q S t r i n g ) ;  
 }  
  
 f u n c t i o n   R e s e t M a n u f a c t u r e r L o g o ( l b l T i t l e C l i e n t I D ,   t d H t m l C o n t e n t C l i e n t I D ,   t x t T i t l e I D ,   f c k C l i e n t I D , t x t U R L I D , l i n k L o g o I D , h i d d e n M a n u f a c t u r e r L i n k I d , r a d i o H i d e I d , r a d i o S h o w I d , c e l l H T M L C o n t e n t I D )   {  
         v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
         v a r   l b l T i t l e   =   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 T i t l e C l i e n t I D ) ;  
         v a r   t d H t m l   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d H t m l C o n t e n t C l i e n t I D ) ;  
         v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e I D ) ;  
         v a r   t x t U R L   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t U R L I D ) ;  
         v a r   h i d d e n M a n u f a c t u r e r L i n k   =   d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n M a n u f a c t u r e r L i n k I d ) ;  
 	   v a r   r a d i o H i d e   =   d o c u m e n t . g e t E l e m e n t B y I d ( r a d i o H i d e I d ) ;      
                 v a r   r a d i o S h o w   =   d o c u m e n t . g e t E l e m e n t B y I d ( r a d i o S h o w I d ) ;  
                 v a r   c e l l H T M L C o n t e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( c e l l H T M L C o n t e n t I D ) ;  
                  
         i f   ( o E d i t o r   ! =   n u l l   & &   t d H t m l   ! =   n u l l )   {  
                 i f ( t d H t m l . i n n e r H T M L   ! =   n u l l )  
                         o E d i t o r . S e t H T M L ( t d H t m l . i n n e r H T M L )  
         }  
         i f ( l b l T i t l e   ! =   n u l l   & &   t x t T i t l e   ! =   n u l l )  
         {  
                 t x t T i t l e . v a l u e   =   t r i m ( l b l T i t l e . i n n e r T e x t ) ;  
         }  
          
         i f ( h i d d e n M a n u f a c t u r e r L i n k   ! =   n u l l   & &   t x t U R L   ! =   n u l l )  
         {  
                 t x t U R L . v a l u e   =   t r i m ( h i d d e n M a n u f a c t u r e r L i n k . v a l u e ) ;  
         }  
          
         i f ( c e l l H T M L C o n t e n t   ! =   n u l l   & &   r a d i o H i d e   ! =   n u l l   & &   r a d i o S h o w   ! =   n u l l )  
         {  
 	 	 i f ( c e l l H T M L C o n t e n t . s t y l e . d i s p l a y   = =   ' n o n e ' )  
 	 	 {  
 	 	 	 r a d i o H i d e . c h e c k e d   =   t r u e ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 r a d i o H i d e . c h e c k e d   =   f a l s e ;  
 	 	 }  
 	 	 r a d i o S h o w . c h e c k e d   =   ! r a d i o H i d e . c h e c k e d  
         }  
          
 }  
  
 f u n c t i o n   S h o w H i d e R M A R e a s o n T y p e ( d r o p D o w n R e t u r n R e a s o n , r o w I t e m N o t N e e d e d I d , r o w D a m a g e d S h i p m e n t I d , r o w D e f e c t i v e I d , r o w I t e m N o t N e e d e d 1 I d , r o w D a m a g e d S h i p m e n t 1 I d , r o w D e f e c t i v e 1 I d , t d N o t e s I d )  
 {  
 	 i f ( d r o p D o w n R e t u r n R e a s o n   ! =   n u l l )  
 	 {  
 	 	 v a r   r o w I t e m N o t N e e 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 ( r o w I t e m N o t N e e d e d I d ) ;  
 	 	 v a r   r o w D a m a g e d S h i p m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w D a m a g e d S h i p m e n t I d ) ;  
 	 	 v a r   r o w D e f e c t i v e   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w D e f e c t i v e I d ) ;  
 	 	 v a r   r o w I t e m N o t N e e d e d 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w I t e m N o t N e e d e d 1 I d ) ;  
 	 	 v a r   r o w D a m a g e d S h i p m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w D a m a g e d S h i p m e n t 1 I d ) ;  
 	 	 v a r   r o w D e f e c t i v e 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w D e f e c t i v e 1 I d ) ;  
 	 	 v a r   t d N o t e s   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d N o t e s I d ) ;  
 	 	  
 	 	 i f ( r o w I t e m N o t N e e d e d   ! =   n u l l   & &   r o w D a m a g e d S h i p m e n t   ! =   n u l l         & &   r o w D e f e c t i v e   ! =   n u l l   & &   r o w I t e m N o t N e e d e d 1   ! =   n u l l  
 	 	   & &   r o w D a m a g e d S h i p m e n t 1   ! =   n u l l   & &   r o w D e f e c t i v e 1   ! =   n u l l     & &   t d N o t e s   ! =   n u l l       )  
 	 	   {  
 	 	 	   r o w I t e m N o t N e e d e d . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	   r o w D a m a g e d S h i p m e n t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	   r o w D e f e c t i v e . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	   r o w I t e m N o t N e e d e d 1 . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	   r o w D a m a g e d S h i p m e n t 1 . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	   r o w D e f e c t i v e 1 . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	   t d N o t e s . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	    
 	 	 	   i f ( d r o p D o w n R e t u r n R e a s o n . v a l u e   = =   ' - 1 '   | |   d r o p D o w n R e t u r n R e a s o n . v a l u e   = =   ' 0 ' )  
 	 	 	   {  
 	 	 	 	   r o w I t e m N o t N e e d e d . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	 	   r o w I t e m N o t N e e d e d 1 . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	   }  
 	 	 	   e l s e   i f ( d r o p D o w n R e t u r n R e a s o n . v a l u e   = =   ' 1 ' )  
 	 	 	   {  
 	 	 	 	   r o w D a m a g e d S h i p m e n t . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	 	   r o w D a m a g e d S h i p m e n t 1 . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	   }  
 	 	 	   e l s e     i f ( d r o p D o w n R e t u r n R e a s o n . v a l u e   = =   ' 2 ' )  
 	 	 	   {  
 	 	 	 	   r o w D e f e c t i v e . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	 	   r o w D e f e c t i v e 1 . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	   }  
 	 	 	   e l s e   i f ( d r o p D o w n R e t u r n R e a s o n . v a l u e   = =   ' 3 ' )  
 	 	 	   {  
 	 	 	 	     t d N o t e s . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	   }  
 	 	   }  
 	 	  
 	 	  
 	 }  
 }  
  
 f u n c t i o n   S e t T o o l T i p F o r S e a r c h ( d i v S e a r c h T o o l T i p I d ,   t y p e )  
 {  
 	 v a r   d i v S e a r c h T o o l T i p   =   d o c u m e n t . g e t E l e m e n t B y I d ( d i v S e a r c h T o o l T i p I d ) ;  
 	 i f ( d i v S e a r c h T o o l T i p   ! =   n u l l )  
 	 {  
 	 	 i f ( t y p e   = =   ' o v e r ' )  
 	 	 {  
 	 	       d i v S e a r c h T o o l T i p . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 }  
 	 	 e l s e   i f ( t y p e   = =   ' o u t ' )  
 	 	 {  
 	 	 	 d i v S e a r c h T o o l T i p . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 }  
 	 }  
 	  
 	 r e t u r n   f a l s e ;  
 }  
  
  
  
  
  
  
  
  
 f u n c t i o n   P r e v i e w M B B o x f o r T y p e 1 ( f c k C l i e n t I D ,   t d P r e v i e w I D ,   t x t T i t l e C l i e n t I D ,   l b l P r e v i e w T i t l e C l i e n t I D ,   m p e P r e v i e w C l i e n t I D ,   b u t t o n I D T o B e D i s a b l e d ,   s e p e r a t o r F o r I D s ,   i s t o B e D i s a b l e d , h t m l T e x t A r e a I D )   {  
         i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0   & &   t d P r e v i e w I D   ! =   n u l l )   {  
                 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
                 v a r   H T M L T e x t   =   ' ' ;  
                 v a r   t i t l e   =   ' ' ;  
                 v a r   t d P r e v i e w   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d P r e v i e w I D ) ;  
                 v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e C l i e n t I D ) ;  
                 v a r   l b l P r e v i e w T i t l e   =   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 P r e v i e w T i t l e C l i e n t I D ) ;  
                  
                 v a r   m p e P r e v i e w   =   $ f i n d ( m p e P r e v i e w C l i e n t I D ) ;  
                 i f   ( m p e P r e v i e w   ! =   n u l l )   {  
                         m p e P r e v i e w . h i d e ( ) ;  
                 }  
                 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l P r e v i e w T i t l e   ! =   n u l l )   {  
                         t i t l e   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                         i f   ( t i t l e   = =   ' ' )   {  
                                 a l e r t ( ' T i t l e   i s   r e q u i r e d . ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
                 }  
                 i f   ( o E d i t o r   ! =   n u l l   & &   t d P r e v i e w   ! =   n u l l )   {  
                         H T M L T e x t   =   o E d i t o r . G e t H T M L ( ) ;  
                         i f   ( H T M L T e x t   = =   u n d e f i n e d   | |   H T M L T e x t   = =   n u l l   | |   t r i m ( H T M L T e x t )   = =   ' ' )   {  
                                 a l e r t ( ' D e s c r i p t i o n   i s   r e q u i r e d . ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
                  
                 }  
                  
 / /                   v a r   t a r e a = d o c u m e n t . g e t E l e m e n t B y I d ( h t m l T e x t A r e a I D ) ;  
 / /                 i f ( t a r e a   ! =   n u l l )  
 / /                 {  
 / /                         t a r e a . i n n e r H T M L   =   ' < t e x t a r e a   i d = " i n n e r C o n v e r t e r P r e v i e w "   s t y l e = " o v e r f l o w : v i s i b l e " > '   +   H T M L T e x t   +   ' < / t e x t a r e a > ' ;    
 / /                         H T M L T e x t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " i n n e r C o n v e r t e r P r e v i e w " ) . v a l u e ;  
 / /                         t a r e a . i n n e r H T M L     =   ' ' ;  
 / /                 }  
                  
                 D i s a b l e B u t t o n s ( b u t t o n I D T o B e D i s a b l e d ,   s e p e r a t o r F o r I D s ,   i s t o B e D i s a b l e d ,   m p e P r e v i e w C l i e n t I D ) ;  
                   t r y  
                         {  
                                 / / t d P r e v i e w . i n n e r H T M L   =     ' < a s p : L i t e r a l   I D = " l i t H T M L P r e v i e w C o n t e n t 1 2 "   r u n a t = " s e r v e r " > '   +   H T M L T e x t + ' < / a s p : L i t e r a l > '   ;  
                                 t d P r e v i e w . i n n e r H T M L   =         H T M L T e x t   ;  
                         }  
                           c a t c h   ( e r r ) { }  
                 / / t d P r e v i e w . i n n e r H T M L   =     H T M L T e x t ;  
                 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l P r e v i e w T i t l e   ! =   n u l l )   {  
                         i f   ( i s f i r e F o x B r o w s e r )   {  
                                 l b l P r e v i e w T i t l e . t e x t C o n t e n t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
  
                         }  
                         e l s e   {  
                                 l b l P r e v i e w T i t l e . i n n e r T e x t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                         }  
                          
                 }  
                 i f   ( m p e P r e v i e w   ! =   n u l l )   {  
                         m p e P r e v i e w . s h o w ( ) ;  
                 }  
         }  
         r e t u r n   f a l s e ;  
 }  
 f u n c t i o n   S a v e M B B o x f o r F o c u s P a g e ( v e n d o r N a m e ,   C o n t r o l I d ,   f c k C l i e n t I D ,   t d I D ,   m p e I D ,   t x t T i t l e C l i e n t I D ,   l b l T i t l e C l i e n t I D , h t m l T e x t A r e a I D )   {  
         i f   ( f c k C l i e n t I D   ! =   n u l l   & &   f c k C l i e n t I D . l e n g t h   >   0   & &   t d I D   ! =   n u l l )   {  
                 v a r   o E d i t o r   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k C l i e n t I D ) ;  
                 v a r   H T M L T e x t   =   ' ' ;  
                 v a r   t i t l e   =   ' ' ;  
                 v a r   t d   =   d o c u m e n t . g e t E l e m e n t B y I d ( t d I D ) ;  
                 v a r   t x t T i t l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t T i t l e C l i e n t I D ) ;  
                 v a r   l b l T i t l e   =   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 T i t l e C l i e n t I D ) ;  
                  
                 i f   ( t x t T i t l e   ! =   n u l l   & &   l b l T i t l e   ! =   n u l l )   {  
                         t i t l e   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                         i f   ( t i t l e   = =   ' ' )   {  
                                 a l e r t ( ' T i t l e   i s   r e q u i r e d . ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
                 }  
                 i f   ( o E d i t o r   ! =   n u l l   & &   t d   ! =   n u l l )   {  
                         H T M L T e x t   =   o E d i t o r . G e t H T M L ( ) ;  
                         i f   ( H T M L T e x t   = =   u n d e f i n e d   | |   H T M L T e x t   = =   n u l l   | |   t r i m ( H T M L T e x t )   = =   ' ' )   {  
                                 a l e r t ( ' D e s c r i p t i o n   i s   r e q u i r e d . ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
                 }  
                  
                
 / /                 v a r   t a r e a = d o c u m e n t . g e t E l e m e n t B y I d ( h t m l T e x t A r e a I D ) ;  
 / /                 i f ( t a r e a   ! =   n u l l )  
 / /                 {  
 / /                         t a r e a . i n n e r H T M L   =   ' < t e x t a r e a   i d = " i n n e r C o n v e r t e r "   s t y l e = " o v e r f l o w : v i s i b l e " > '   +   H T M L T e x t   +   ' < / t e x t a r e a > ' ;    
 / /                         H T M L T e x t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " i n n e r C o n v e r t e r " ) . v a l u e ;  
 / /                         t a r e a . i n n e r H T M L     =   ' ' ;  
 / /                 }  
                 v a r   H T M L T e x t 1   =   H T M L T e x t ;  
                 H T M L T e x t 1   =   R e p l a c e A l l ( H T M L T e x t , ' + ' , ' # # # # # ' ) ;  
                 / / H T M L T e x t 1   =   H T M L T e x t . r e p l a c e ( e v a l ( ' / & / g ' ) , ' # # # # # ' ) ;  
                 H T M L T e x t 1   =   e n c o d e U R I C o m p o n e n t ( H T M L T e x t 1 ) ;  
                 / / H T M L T e x t = r e p l a c e E x t C h a r s ( H T M L T e x t , t r u e ) ;  
                 v a r   r e s u l t   =   D o A j a x C a l l F o r F o c u s P a g e ( v e n d o r N a m e ,   C o n t r o l I d ,   t i t l e , H T M L T e x t 1 , t r u e ) ;  
                 i f   ( r e s u l t   = =   0 )   {  
                         a l e r t ( ' T h e r e   w a s   s o m e   e r r o r   i n   s a v i n g   d a t a . ' ) ;  
                 }  
                 e l s e   {  
                         t r y  
                         {  
                                 / / t d . i n n e r H T M L   =     ' < a s p : L i t e r a l   I D = " l i t H T M L P r e v i e w C o n t e n t "   r u n a t = " s e r v e r " > '   +   H T M L T e x t + ' < / a s p : L i t e r a l > '   ;  
                                 t d . i n n e r H T M L   =     H T M L T e x t   ;  
                         }  
                           c a t c h   ( e r r ) { }  
  
                         t d . s t y l e . h e i g h t   =   " a u t o " ;  
                         i f   ( t d . p a r e n t N o d e   ! =   n u l l )   {  
                                 t d . p a r e n t N o d e . s t y l e . h e i g h t   =   " a u t o " ;  
                         }  
                         i f   ( t x t T i t l e   ! =   n u l l   & &   l b l T i t l e   ! =   n u l l )   {  
                                 i f   ( ! i s f i r e F o x B r o w s e r )   {  
                                         l b l T i t l e . i n n e r T e x t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                                 }  
                                 e l s e   {  
                                         l b l T i t l e . t e x t C o n t e n t   =   t r i m ( t x t T i t l e . v a l u e ) ;  
                                 }  
                         }  
                         v a r   m p e   =   $ f i n d ( m p e I D ) ;  
                         i f   ( m p e   ! =   n u l l )  
                         {   m p e . h i d e ( ) ;   }  
                 }  
  
         }  
         r e t u r n   f a l s e ;  
 }  
  
  
 f u n c t i o n   S e t P r o d u c t D e t a i l L i n k ( o b j e c t , h i d d e n P r o d u c t I d , p r o d u c t D e t a i l U r l )  
 {  
 	 v a r   h i d d e n P r o d u c t   =   d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n P r o d u c t I d ) ;  
  
 	 	 i f   ( h i d d e n P r o d u c t   ! =   n u l l )  
 	 	 {  
 	 	 	 w i n d o w . l o c a t i o n . h r e f   =   p r o d u c t D e t a i l U r l   +   h i d d e n P r o d u c t . v a l u e ;  
 	 	 }  
 	 	 r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   S h o w H i d e O p t i o n L i s t ( d d l O p t i o n , c e l l O p t i o n B u t t o n I d ,   t x t O p t i o n N a m e I d ,   r o w O p t i o n T e x t I d , r o w O p t i o n L i s t H e a d e r I d , r o w O p t i o n S e p e r a t o r I d , r o w O p t i o n L i s t I d )  
 {  
 	 v a r   r o w O p t i o n T e x t   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w O p t i o n T e x t I d ) ;  
 	 v a r   r o w O p t i o n L i s t H e a d e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w O p t i o n L i s t H e a d e r I d ) ;  
 	 v a r   r o w O p t i o n S e p e r a t o r   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w O p t i o n S e p e r a t o r I d ) ;  
 	 v a r   r o w O p t i o n L i s t   =   d o c u m e n t . g e t E l e m e n t B y I d ( r o w O p t i o n L i s t I d ) ;  
 	  
 	 v a r   c e l l O p t i o n B u t t o n   =   d o c u m e n t . g e t E l e m e n t B y I d ( c e l l O p t i o n B u t t o n I d ) ;  
 	 v a r   t x t O p t i o n N a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( t x t O p t i o n N a m e I d ) ;  
 	  
 	  
 	 i f ( d d l O p t i o n   ! =   n u l l   & &   c e l l O p t i o n B u t t o n   ! =   n u l l   & &   t x t O p t i o n N a m e   ! =   n u l l   & &   r o w O p t i o n T e x t   ! =   n u l l   & &   r o w O p t i o n L i s t H e a d e r   ! =   n u l l   & &   r o w O p t i o n S e p e r a t o r   ! =   n u l l   & &   r o w O p t i o n L i s t   ! =   n u l l )  
 	 {  
 	 	 i f ( d d l O p t i o n . v a l u e   = = " 1 " )  
 	 	 {  
 	 	 	 c e l l O p t i o n B u t t o n . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 	 t x t O p t i o n N a m e . d i s a b l e d   =   f a l s e ;  
 	 	 	 / / r o w O p t i o n T e x t . s t y l e . d i s p l a y   =   ' ' ;  
 / / 	 	 	 r o w O p t i o n L i s t H e a d e r . s t y l e . d i s p l a y   =   ' ' ;  
 / / 	 	 	 r o w O p t i o n S e p e r a t o r . s t y l e . d i s p l a y   =   ' ' ;  
 / / 	 	 	 r o w O p t i o n L i s t . s t y l e . d i s p l a y   =   ' ' ;  
 	 	 }  
 	 	 e l s e    
 	 	 {  
 	 	 	 c e l l O p t i o n B u t t o n . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	 t x t O p t i o n N a m e . d i s a b l e d   = t r u e ;  
 	 	 	 / / r o w O p t i o n T e x t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 / / 	 	 	 r o w O p t i o n L i s t H e a d e r . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 / / 	 	 	 r o w O p t i o n S e p e r a t o r . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 / / 	 	 	 r o w O p t i o n L i s t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 }  
 	 }  
 	  
 }  
 f u n c t i o n   A d d S u b L e v e l Q u e s t i o n s ( d r o p D o w n L i s t O p t i o n , h i d d e n Q u e s I D , t a b l e S u b Q u e s t i o n C l i e n t I d , d i v C h i l d Q u e s t C l i e n t I D )  
 {    
 v a r   r e q u i r e d C h o i c e = d o c u m e n t . g e t E l e m e n t B y I d ( r e q u i r e d C h o i c e C l i e n t I d ) ;  
     v a r   l i s t = d o c u m e n t . g e t E l e m e n t B y I d ( t a b l e S u b Q u e s t i o n C l i e n t I d ) ;  
     v a r   Q u e s I d = d o c u m e n t . g e t E l e m e n t B y I d ( h i d d e n Q u e s I D ) ;  
     v a r   d d l O p t i o n = d o c u m e n t . g e t E l e m e n t B y I d ( d r o p D o w n L i s t O p t i o n ) ;  
      
     f o r ( v a r   i = 0 , r o w ; r o w = l i s t . r o w s [ i ] ; i + + )  
     {  
           i f (   r o w . i d . i n d e x O f ( ' t r S u b S u b L e v e l L i s t ' ) > 0 )  
           {  
                 f o r ( v a r   j = 0 , c e l l ; c e l l = r o w . c e l l s [ j ] ; j + + )  
                 {  
                     v a r   h i d d e n f i e l d s = c e l l . g e t E l e m e n t s B y T a g N a m e ( ' i n p u t ' ) ;  
                      
                     i f ( h i d d e n f i e l d s . l e n g t h > 0   & &   h i d d e n f i e l d s [ 0 ] . v a l u e = = Q u e s I d . v a l u e   & &   h i d d e n f i e l d s [ 2 ] . v a l u e = = d r o p D o w n L i s t O p t i o n . v a l u e )  
                     {  
                         r o w . s t y l e . d i s p l a y = ' ' ;  
                        
                          
                           b r e a k ;  
                     }  
                     e l s e  
                     {  
                         r o w . s t y l e . d i s p l a y = " n o n e " ;  
                          
  
                     }  
                 }  
           }  
          
     }  
        
         r e t u r n   t r u e ;  
 }  
  
  
  
 
