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