ÿþv a r   v i e w C a r t S t a t u s   =   0 ;  
 v a r   i s C o l l e c t i o n = " " ;  
 v a r   c a r t l e n g t h ;  
 v a r   l o g g e d i n ;  
 v a r   i t e m n a m e t m p ;                        
 v a r   d i r e c t b u y   =   " t r u e " ;  
 v a r   s e l t e s t = " s e l e c t " ;  
 v a r   l o g s t a t e ; / / t o   i d e n t i f y   t h e   l o g i n   s t a t u s   f o r   v a r i a u s   v e r i f i c a t i o n s   w r t   c u s t o m e r   o p e r a t i o n  
 v a r   n e w h t m l   =   " " ;  
 v a r   r e c o r d p o i n t e r ;   / /   n e w   v a r i a b l e   f o r   s t o r e   a   p o i n t e d   r e c o r d   n u m b e r .    
 v a r   d c h a r g e   =   " 0 " ;  
 v a r   s i n g l e i t e m Q u a n t i t y ;  
 v a r   i s s u e = " " ;  
 v a r   s e a r c h a t t r i b u t e ;  
 v a r   b l n c h e c k m e s s a g e ;  
 v a r   b l n M e s s a g e ;  
  
  
 f u n c t i o n   $ ( )    
 {  
 v a r   e l e m e n t s   =   n e w   A r r a y ( ) ;  
 	 f o r   ( v a r   i   =   0 ;   i   <   a r g u m e n t s . l e n g t h ;   i + + )    
 	 {  
 	 	 v a r   e l e m e n t   =   a r g u m e n t s [ i ] ;  
 	 	 i f   ( t y p e o f   e l e m e n t   = =   ' s t r i n g ' )  
 	 	 	 e l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( e l e m e n t ) ;  
 	 	 i f   ( a r g u m e n t s . l e n g t h   = =   1 )   r e t u r n   e l e m e n t ;  
 	 	 e l e m e n t s . p u s h ( e l e m e n t ) ;  
 	 }  
 	 r e t u r n   e l e m e n t s ;  
 }  
  
  
 v a r   C a t e g o r y ,   J o u r n a l C a t e g o r y , P u b l i s h e r s , C o l l e c t i o n s , P r o d u c t s , t o p S e l l e r s , T o p S e l l e r s A u t h o r s , M a g a z i n e C a t e g o r y   =   n e w   A r r a y ( ) ;  
 v a r   C a r t   =   n e w   A r r a y ( ) ;  
  
 v a r   p r o d u c t u r l s   =   {  
          
         C a t e g o r y : " . . / d e f a u l t x . a s p x ? r n d = "   + M a t h . r a n d o m ( ) +   " & f i l t e r = C a t e g o r y " ,  
         J o u r n a l C a t e g o r y : " . . / d e f a u l t x . a s p x ? r n d = "   + M a t h . r a n d o m ( ) +   " & f i l t e r = J o u r n a l C a t e g o r y " ,  
         M a g a z i n e C a t e g o r y : " . . / d e f a u l t x . a s p x ? r n d = "   + M a t h . r a n d o m ( ) +   " & f i l t e r = M a g a z i n e C a t e g o r y " ,  
 	 P u b l i s h e r s : " . . / d e f a u l t x . a s p x ? r n d = "   + M a t h . r a n d o m ( ) +   " & f i l t e r = P u b l i s h e r s " ,  
 	 s i n g l e : " . . / d e f a u l t x . a s p x ? r n d = "   + M a t h . r a n d o m ( ) +   " & f i l t e r = B o o k s " ,  
         C o l l e c t i o n s : " . . / d e f a u l t x . a s p x ? r n d = "   + M a t h . r a n d o m ( ) +   " & f i l t e r = C o l l e c t i o n s "  
 } ;  
  
 f u n c t i o n   i n i t i a l i z e ( )  
 {  
       v a r   p a r a m f i l t e r   =   g e t U R L P a r a m ( " f i l t e r " ) ;  
       i f   ( p a r a m f i l t e r = = " c a t e g o r y "   | | p a r a m f i l t e r = = " j o u r n a l c a t e g o r y " )  
       {  
 	   d i s p l a y P r o d u c t s ( P r o d u c t s ) ;  
       }  
       e l s e  
       {  
           b l n c h e c k m e s s a g e =   d i s p l a y M e s s a g e ( ) ;  
 	   i f   ( b l n c h e c k m e s s a g e = = f a l s e )  
 	   {  
 	         d i s p l a y P r o d u c t P a g e s ( 0 , ' d i s p l a y P r o d u c t P a g e s ' ) ;  
 	     }  
 	    
 	 }  
 	   v a r   s e a r c h C o m b o U r l   =   ' D a t a . a s p x ? m o d e = m a i n & r n d = ' + M a t h . r a n d o m ( ) + ' & a c t i o n = s e a r c h c o m b o ' ;    
 	   h a n d l e R e q u e s t ( G E T ,   s e a r c h C o m b o U r l ,   f u n P o p u l a t e G r o u p s ) ;  
  
 	  
 	 i f ( ( S e a r c h . l e n g t h   ! =   0 ) & &   ( S e a r c h [ 0 ] . i d   ! = 0 ) )  
 	 {  
 	 	 d i s p l a y P r o d u c t s ( S e a r c h ) ;  
 	 }  
 	     l o g i n S t a t u s ( ) ;  
             b l n c h e c k m e s s a g e =   d i s p l a y M e s s a g e ( ) ;  
              
       / / c o d e   a d d e d   b y   s e n t h i l   g i v e n   b y   b h a r a t h i   o n   1 1 / 0 9 / 0 9  
 	 v a r   C a t a l o g U R L = ' D a t a . a s p x ? m o d e = m a i n & r n d = ' + M a t h . r a n d o m ( ) + ' & a c t i o n = C a t a l o g ' ;  
 	 h a n d l e R e q u e s t ( G E T , C a t a l o g U R L , S h o w C a t a l o g , p r o g r e s s ) ;  
 	  
 	 v a r   L o g o U R L = ' D a t a . a s p x ? m o d e = m a i n & r n d = ' + M a t h . r a n d o m ( ) + ' & a c t i o n = L o g o I m a g e ' ;  
 	 h a n d l e R e q u e s t ( G E T , L o g o U R L , f u n S h o w L o g o , p r o g r e s s ) ;  
 	 / / e n d   h e r e   b h a r a t h i  
  
 }  
 B e h a v i o u r . a d d L o a d E v e n t ( f u n F i n d P a g e ) ;  
  
 f u n c t i o n   d i s p l a y M e s s a g e ( )  
 {  
   v a r   b l n M e s s a g e = f a l s e ;  
                    
         i f ( ( C u s t . l e n g t h = = 0 ) )  
         {  
 	 	 C u s t = [ { i d : " " , F i r s t N a m e : " " , L a s t N a m e : " " , E m a i l : " " , U s e r N a m e : " " , a d d r e s s 1 : " " , a d d r e s s 2 : " " , c i t y : " " , c o u n t y : " " , P o s t C o d e : " " , c o u n t r y : " " , t e l e p h o n e : " " , m o b i l e : " " } ] ;  
 	 }  
 	 e l s e   i f ( ( C u s t [ 0 ] . i d = = 0   & &   C u s t [ 0 ] . F i r s t N a m e ! = ' ' ) )  
 	 {  
 	 	 i f ( C u s t [ 0 ] . U s e r N a m e . s u b s t r i n g ( 0 , 6 ) = = ' E x i s t s ' )  
 	 	 {  
 	 	  
 	 	   b l n M e s s a g e =   t r u e ;  
 	     	 	 v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < c e n t e r > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > U s e r   n a m e   a l r e a d y   e x i s t s .   C h o o s e   d i f f e r e n t   E m a i l   I D < / f o n t > < / b > < / c e n t e r > < / s p a n > " ;  
 	         	 c h e c k u s e r e m a i l ( h t m l ) ;  
 	 	 }  
 	 	 i f ( C u s t [ 0 ] . E m a i l . s u b s t r i n g ( 0 , 6 ) = = ' E x i s t s ' )  
 	 	 {  
 	 	   b l n M e s s a g e =   t r u e ;  
 	 	 	 v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < c e n t e r > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > E m a i l   a l r e a d y   e x i s t s .   C h o o s e   d i f f e r e n t   E m a i l I d . < / f o n t > < / b > < / c e n t e r > < / s p a n > " ;  
 	 	         c h e c k u s e r e m a i l ( h t m l ) ;  
 	 	 }  
                 i f ( C u s t [ 0 ] . F i r s t N a m e = = ' E m a i l S e n t ' )  
 	 	 {  
 	 	   b l n M e s s a g e =   t r u e ;  
 	 	 	 v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < c e n t e r > < b > < f o n t   s i z e = 2   c o l o r = ' # 8 B 0 0 0 0 '   & n b s p ; & n b s p ; & n b s p ; & n b s p ; > N e w   P a s s w o r d   h a s   b e e n   s e n t   t o   y o u r   M a i l   I d . < / f o n t > < / b > < / c e n t e r > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 	 }  
  
                 i f ( C u s t [ 0 ] . F i r s t N a m e = = ' E m a i l F a i l e d ' )  
 	 	 {  
 	 	   b l n M e s s a g e =   t r u e ;  
 	 	 	 v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < c e n t e r > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; " ;  
                           h t m l   + =   " < b r > < b r > < c e n t e r > E n t e r   a   V a l i d   E m a i l   < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / c e n t e r > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 	 	 v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	 	 $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
                         $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	 }  
 	 	 i f ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' )  
 	 	 {  
                         b l n M e s s a g e =   t r u e ;  
                         / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   g i v e n   b y   k i r u t h i k a   o n   1 8 / 1 2 0 / 9   t o   c h a n g e   t h e   d i s p l a y   m e s s a g e   w h e n   t h e   u s e r   r e g i s t e r s   w i t h   s a n g a p a l a g a i   a s   p e r   c l i e n t   r e q u i r e m e n t  
                         / / v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < c e n t e r > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < b r > < b r > < c e n t e r > A n   e m a i l   i s   s e n t   w i t h   a n   a c t i v a t i o n   l i n k . < / c e n t e r > " ;  
                         / / h t m l   + =   " < b r > < b r > < c e n t e r > P l e a s e   c l i c k   o n   t h e   l i n k   i n   y o u r   e m a i l   t o   a c t i v a t e   y o u r   a c c o u n t .   < / c e n t e r > " ;  
                         / / h t m l   + =   " < b r > < b r > < c e n t e r > A n d   y o u   w i l l   b e   a b l e   t o   d o w n l o a d   t h e   S P   R e a d e r .   < / c e n t e r > < b r > " ;  
                         / / h t m l   + =   " < / c e n t e r > < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < b r > < b r > < c e n t e r > < h 4 > T h a n k   Y o u   f o r   r e g i s t e r i n g   w i t h   S a n g a p a l a g a i . < / h 4 > < / c e n t e r > " ;  
                                 h t m l   + =   " < b r > < b r > < p > A n   e m a i l   i s   s e n t   t o   y o u r   E m a i l   I D   w i t h   a n   a c t i v a t i o n   l i n k . < / p > < / n > " ;  
                                 h t m l + = " < p > P l e a s e   c l i c k   y o u r   E m a i l   a n d   c l i c k   o n   t h e   a c t i v a t i o n   l i n k   a n d   a c t i v a t e   y o u r   a c c o u n t . A n d   y o u   w i l l   b e   a b l e   t o   d o w n l o a d   t h e   S P   R e a d e r . < / p > < / n > " ;  
                                 h t m l   + = " < p > U s e   I n t e r n e t   E x p l o r e r   b r o w s e r . < / p > < / n > " ;  
                                 h t m l   + = " < p > T o   r e a d   a n y   B o o k / M a g a z i n e   d o w n l o a d e d   f r o m   s a n g a p a l a g a i . c o m   y o u   n e e d   S P   R e a d e r . < / p > < / n > " ;  
                                 h t m l + =   " < b r > < p > F o r   a n y   a s s i s t a n c e   w r i t e   t o   < a   h r e f = \ " m a i l t o : s a n g a p a l a g a i @ g m a i l . c o m \ " > < f o n t   c o l o r = \ " B l u e \ " > < u > s a n g a p a l a g a i @ g m a i l . c o m < / u > < / f o n t >   < / a > < / p > < b r > < / n > " ;  
                                 h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                         / / E n d   h e r e  
  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 	 	 v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	 	 d o c u m e n t . f r m L o g i n . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
 	 	 	 $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
  
 	 	 }  
 	 }  
 	 e l s e   i f ( ( C u s t [ 0 ] . i d = = 0 )   & &   ( C u s t [ 0 ] . F i r s t N a m e . s u b s t r i n g ( 0 , 1 1 ) ! = ' L o g i n F a i l e d ' )   & &   ( C u s t [ 0 ] . F i r s t N a m e ! = " " ) )  
 	 {  
 	 	 m y A c c o u n t D e t a i l s ( ) ;  
 	 }  
 	 e l s e   i f ( ( C u s t [ 0 ] . i d > 0 )   & &   ( C u s t [ 0 ] . E m a i l . s u b s t r i n g ( 0 , 6 ) = = ' E x i s t s ' ) )  
 	 {  
 	 	 m y A c c o u n t D e t a i l s ( ) ;  
 	 }  
 	 e l s e   i f ( ( C u s t [ 0 ] . F i r s t N a m e . s u b s t r i n g ( 0 , 1 1 ) = = ' L o g i n F a i l e d ' )   & &   ( C u s t [ 0 ] . i d > 0 ) )  
 	 {  
 	   b l n M e s s a g e =   t r u e ;  
 	 	 v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < c e n t e r > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > W r o n g   ' O l d   P a s s w o r d ' .   E n t e r   t h e   c o r r e c t   P a s s w o r d . < / f o n t > < / b > < / c e n t e r > < / s p a n > " ;  
 	 	 v a r   e l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " f l a s h C o n t e n t " ) ;  
 	 	 e l e m e n t . i n n e r H T M L = h t m l ;  
 	 	 v a r   r e g = "   " ;  
 	 	 v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " l i s t P r o d u c t s " ) ;  
 	 	 e l e m e n t 1 . i n n e r H T M L = r e g ;  
 	 	 c h a n g e P a s s w o r d ( ) ;  
 	 } 	  
  
 	 i f ( ( R e v i e w . l e n g t h = = 0 ) )  
 	 {  
 	 	 R e v i e w = [ { I d : " " , c o m m e n t : " " } ] ;  
 	 }  
         e l s e   i f ( R e v i e w [ 0 ] . c o m m e n t = = ' R e v i e w s e n t ' )  
 	 {  
 	 	   b l n M e s s a g e =   t r u e ;  
                         / / c o d e   c o m m e n t   a n d   a d d e d   b y   b h a r a t h i   o n   2 1 / 0 3 / 0 9   f o r   c h a n g e   t h e   m e s s a g e   i n   t a m i l 	 	    
                         / / v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > & n b s p ; ¨©Í±¿. < / c e n t e r > " ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > " ;  
                         / / h t m l   + =   " < b r > < b r > < c e n t e r > & n b s p ;   T h a n k   y o u   f o r   y o u r   v a l u a b l e   c o m m e n t s . < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > & n b s p ;   …©ÍªÁ³Í³  š™Í•ªÍª²•È  µ¾š•°Á•Í•Á< / c e n t e r > < b r > " ;  
                         h t m l   + =   " < c e n t e r > & n b s p ;   ¤™Í•³ÁŸÈ¯  ®Ç²¾©  •°Á¤Í¤Á•Í•Á  ¨©Í±¿. < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < c e n t e r > & n b s p ;   ‰™Í•³Á•Í•Á  µ¿°ÁªÍª®¾©  ªÁ¤Í¤•™Í•³Í/ ª¤Í¤¿°¿•Í•È•³Í,   š™Í•ªÍª²•È  ®Â²®¾•  µ¾™Í•  µ¿°Á®Íª¿©¾²Í, < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < c e n t e r > & n b s p ;   …¤©È  Ž™Í•³Á•Í•Á  ¤Æ°¿µ¿•Í•Á®¾±Á  •ÇŸÍŸÁ•Í  •Ê³Í•¿±Ë®Í. < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < c e n t e r > & n b s p ;   ¨¾™Í•³Í  ¤ÊŸ°Í¨Í¤Á  ª²  …±¿¯  ¤®¿´Í  ªÁ¤Í¤•™Í•³È  š™Í•ªÍª²•È  µ²È  ¤³¤Í¤¿²Í< / c e n t e r > < b r > " ;  
                         h t m l   + =   " < c e n t e r > & n b s p ;   …ªÍ²ËŸÁ  šÆ¯Í¤Áµ°Á•¿±Ë®Í  …¤©¾²Í  ¤ÊŸ°Í¨Í¤Á  < a > w w w . s a n g a p a l a g a i . c o m < / a > ®È  •¿³¿•Í  šÆ¯Í¤Á  ªÁ¤¿¯  µ°µÁ•³È  ª¾°Í•Í•µÁ®Í. < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > & n b s p ; & n b s p ;   ¨©Í±¿. < b r > " ;  
                         h t m l   + =   " & n b s p ; & n b s p ;   …©ÍªÁŸ©Í< b r > " ;  
                         h t m l   + =   " & n b s p ; & n b s p ;   M . A . ª¾°Í¤Í¤š¾°¤¿< b r > " ;  
                                              
                         / / e n d   h e r e   b h a r a t h i   o n   2 1 / 0 3 / 0 9  
  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 i f ( ( F e e d B a c k . l e n g t h = = 0 ) )  
 	 {  
 	 	 F e e d B a c k = [ { I d : " " , c o u n t r y : " " , u s e r t y p e : " " , c o m m e n t : " " , r a t e : " " , s u g g e s t i o n : " " , c r i t i z e : " " , f e a t u r e s : " " , a d d i t i o n s : " " } ] ;  
 	 }  
         e l s e   i f ( F e e d B a c k [ 0 ] . a d d i t i o n s = = ' F e e d B a c k s e n t ' )  
 	 {  
 	   b l n M e s s a g e =   t r u e ;  
 	 	  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > & n b s p ; ¨©Í±¿. < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > & n b s p ; T h a n k s   f o r   y o u r   F e e d b a c k .   < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 	  
 	 e l s e   i f ( F e e d B a c k [ 0 ] . a d d i t i o n s = = ' C h a n g e F a i l e d ' )  
 	 {  
 	   b l n M e s s a g e =   t r u e ;  
 	 	         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > & n b s p ; O l d   P a s s w o r d   i s   W r o n g .   P l e a s e   E n t e r   a   C o r r e c t   P a s s w o r d . < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                         p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 	 	  
 	 }  
 	 e l s e   i f ( F e e d B a c k [ 0 ] . a d d i t i o n s = = ' C h a n g e S u c c e s s ' )  
 	 {  
 	   b l n M e s s a g e =   t r u e ;  
 	 	         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > & n b s p ; P a s s w o r d   h a s   b e e n   C h a n g e d . < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                         p a s s w o r d e m a i l e d ( h t m l ) ; 	 	 	  
 	 }  
 	 i f   ( D o w n l o a d e d . l e n g t h ! = 0 )  
 	 {  
 	     i f ( D o w n l o a d e d [ 0 ] . d o w n l o a d = = ' N o M a c I D ' )  
 	     {  
 	               b l n M e s s a g e =   t r u e ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > S o r r y ! . < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > P l e a s e   R e g i s t e r   O n c e   A g a i n   < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                         h t m l   + =   " < f o r m   n a m e = ' f r m S a n g a p a l a g a i R e g i s t e r '   m e t h o d = ' p o s t '   a c t i o n   =   ' D o w n l o a d R e g i s t e r ' > " ;  
                         h t m l   + =   ' < c e n t e r > < i n p u t   t y p e = " b u t t o n "   v a l u e = " R e g i s t e r "   o n c l i c k = "   r e t u r n   D o w n l o a d ( t h i s . f o r m ) "   i d = " B u t t o n 1 " / > < / f o r m > ' ;  
                          
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	     }  
 	      
 	       i f ( D o w n l o a d e d [ 0 ] . d o w n l o a d = = ' N o S e s s i o n ' )  
 	     {  
 	               b l n M e s s a g e =   t r u e ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > S o r r y ! . < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > Y o u r   S e s s i o n   h a s   b e e n   e x p i r e d .   P l e a s e   l o g i n   a g a i n   < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                          
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	     }  
         }  
                 / / a d d e d   b y   d e e p i k a   o n   1 7 / 0 4 / 0 9  
         i f ( C u s t [ 0 ] . i d ! = 0 )  
         {  
           i f   ( C u s t S u c c e s s . l e n g t h ! = 0 )  
 	 {  
 	     i f ( C u s t S u c c e s s [ 0 ] . C S u c c e s s = = ' C u s t D e t a i l s S u c c e s s ' )  
 	     {  
 	                 b l n M e s s a g e =   t r u e ;  
 	                 v i e w C a r t ( C a r t ) ;  
 	     }  
   	 }  
   	 }  
          
         / / e n d   h e r e  
         i f   ( P a y m e n t . l e n g t h ! = 0 )  
 	 {  
 	     i f ( P a y m e n t [ 0 ] . P a y m e n t = = ' P a y m e n t S u c c e s s f u l l ' )  
 	     {  
 	                 b l n M e s s a g e =   t r u e ;  
                         t r a n s a c t i o n ( ) ;  
   	     }  
   	     e l s e   i f ( P a y m e n t [ 0 ] . P a y m e n t = = ' P a y m e n t P e n d i n g ' )  
 	     {  
 	                  
 	                 b l n M e s s a g e =   t r u e ;  
 	                                  
                           v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > S o r r y ! . P a y m e n t   P e n d i n g     < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > A f t e r   P a y m e n t   c o m p l e t e d   Y o u   c a n   d o w n l o a d   t h e   B o o k s < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 	 	  
   	     }  
   	     e l s e  
   	     {  
   	     	   b l n M e s s a g e =   t r u e ;  
   	                 v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > S o r r y ! . < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > Y o u r   P a y m e n t   i s   n o t   v a l i d < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
   	     }  
         }  
         i f ( ( G i f t S t a t u s . l e n g t h = = 0 ) )  
 	 {  
   	 	 G i f t S t a t u s = [ { I d : " " , P r o d u c t I d : " " , S e n d e r I D : " " , R e c e i v e r I D : " " , M a i l s t a t u s : " " } ] ;  
 	 }  
         e l s e   i f ( G i f t S t a t u s [ 0 ] . M a i l s t a t u s   = =   ' G i f t s e n t ' )  
 	 {  
 	   b l n M e s s a g e =   t r u e ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > ¨©Í±¿. < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > G i f t   h a v e   b e e n   s e n t   t o   :   < b r > "   +   G i f t S t a t u s [ 0 ] . R e c e i v e r I D   + " < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 e l s e   i f ( G i f t S t a t u s [ 0 ] . M a i l s t a t u s = = ' G i f t F a i l e d ' )  
 	 {  
                         b l n M e s s a g e =   t r u e ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > ¨©Í±¿. < / c e n t e r > " ;  
                         / / C o m m e n t e d   a d d e d   b y   s e n t h i l   o n   1 0 / 0 6 / 2 0 0 9   f o r   c h a n g e   t h e   s e n t a n c e  
                         / / h t m l   + =   " < b r > < b r > < c e n t e r > S o r r y ! ! !   Y o u   a l r e a d y   D o w n l o a d   t h e   B o o k . < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > S o r r y ! !   Y o u   h a v e   a l r e a d y   d o w n l o a d e d   t h i s   b o o k . < / c e n t e r > < b r > " ;  
                         / / e n d   h e r e  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                         h t m l   + = ' < f o r m   n a m e = " f r m G i f t 1 "   m e t h o d = " p o s t "   a c t i o n   =   " G i f t " > < t d   > < i n p u t   t y p e = " b u t t o n "   n a m e = " b t n b a c k "   v a l u e =   " B a c k "   O n C l i c k = " r e t u r n   t r a n s a c t i o n ( t h i s . f o r m ) ; " / > < / t d > < / f o r m > ' ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 / / c o d e   a d d e d   b y   m a g e s h   o n   0 4 / 0 4 / 0 9   t o   d i s p l a y   t h e   g i f t   a l r e a d y   a v a i l a b l e   m e s s a g e  
 	 e l s e   i f ( G i f t S t a t u s [ 0 ] . M a i l s t a t u s = = ' G i f t A l r e a d y A v a i l a b l e ' )  
 	 {  
                         b l n M e s s a g e =   t r u e ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > ¨©Í±¿. < / c e n t e r > " ;  
                         / / h t m l   + =   " < b r > < b r > < c e n t e r > S o r r y ! ! !   M a g a z i n e   i s   a l r e a d y   a v a i l a b l e . < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > S o r r y ! ! !   T h e   u s e r   h a s   a l r e a d y   s u b s c r i b e d   f o r   t h i s   M a g a z i n e   . < / c e n t e r > < b r > " ;  
                         / / e n d   h e r e  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                         h t m l   + = ' < f o r m   n a m e = " f r m G i f t 1 "   m e t h o d = " p o s t "   a c t i o n   =   " G i f t " > < t d   > < i n p u t   t y p e = " b u t t o n "   n a m e = " b t n b a c k "   v a l u e =   " B a c k "   O n C l i c k = " r e t u r n   t r a n s a c t i o n ( t h i s . f o r m ) ; " / > < / t d > < / f o r m > ' ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 / / c o d e   a d d e d   b y   m a g e s h   o n   2 8 / 0 4 / 0 9   t o   d i s p l a y   t h e   g i f t   a l r e a d y   a v a i l a b l e   m e s s a g e  
 	 e l s e   i f ( G i f t S t a t u s [ 0 ] . M a i l s t a t u s = = ' G i f t M a i l N o t A v a i l a b l e ' )  
 	 {  
                         b l n M e s s a g e =   t r u e ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > ¨©Í±¿. < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > S o r r y ! ! !   S e l e c t e d   m a i l   i d   i s   n o t   r e g i s t e r e d   y e t . < / c e n t e r > < b r > " ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
                         h t m l   + = ' < f o r m   n a m e = " f r m G i f t 1 "   m e t h o d = " p o s t "   a c t i o n   =   " G i f t " > < t d   > < i n p u t   t y p e = " b u t t o n "   n a m e = " b t n b a c k "   v a l u e =   " B a c k "   O n C l i c k = " r e t u r n   t r a n s a c t i o n ( t h i s . f o r m ) ; " / > < / t d > < / f o r m > ' ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 / / E n d   h e r e  
  
 	 e l s e   i f ( G i f t S t a t u s [ 0 ] . S e n d e r I D   = =   ' R e g i s t e r U s e r ' )  
 	 {  
 	 	   b l n M e s s a g e =   t r u e ;  
 	               v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < c e n t e r > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > ¨©Í±¿. " ;  
                         h t m l   + =   " < b r > < b r >   G i f t   h a v e   b e e n   s e n t   t o   :   < b r > "   +   C u s t [ 0 ] . E m a i l ;  
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / c e n t e r > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 e l s e   i f ( G i f t S t a t u s [ 0 ] . M a i l s t a t u s = = ' D o w n l o a d s e n t ' )  
 	 {  
 	   b l n M e s s a g e =   t r u e ;  
                         v a r   h t m l   =   " < s p a n   c l a s s = ' p r o m o P r o d u c t D e s c ' > < b > < f o n t   c o l o r = ' # 8 B 0 0 0 0 ' > < b r > < b r > < c e n t e r > ¨©Í±¿. < / c e n t e r > " ;  
                         h t m l   + =   " < b r > < b r > < c e n t e r > S o r r y ! ! !   y o u   a r e   a l r e a d y   G i f t   t h i s   b o o k . < / c e n t e r > " ;    
                         h t m l   + =   " < b r > < b r > < / f o n t > < / b > < / s p a n > " ;  
 	 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 	 }  
 	 r e t u r n   b l n M e s s a g e ;  
 }  
 v a r   P a g e N a m e   =   " " ;  
 f u n c t i o n   f u n F i n d P a g e ( )  
 {  
           P a g e N a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( " P a g e N a m e " ) . v a l u e ;  
 	 i f (   P a g e N a m e   = =   " d e f a u l t " )  
 	   o n P a g e l o a d ( ) ;  
 	   e l s e  
 	   i n i t i a l i z e ( ) ;  
 }  
 f u n c t i o n   p o p u l a t e I m a g e s ( )    
 {  
   v a r   s e l e c t   =   " " ;    
   i f   ( F r e e F l a s h [ 0 ] . i d ! = 0 )  
 {  
         s e l e c t   + =   ' < o b j e c t > ' ;  
         s e l e c t   + = ' < p a r a m   n a m e = " m o v i e "   v a l u e = " F r e e F l a s h . s w f " > ' ;  
         s e l e c t   + = ' < p a r a m   n a m e = " q u a l i t y "   v a l u e = " h i g h " > ' ;  
         s e l e c t   + = ' < e m b e d   n a m e = " P a r t h i p a n "   s r c = " ' + F r e e F l a s h [ 0 ] . i m a g e + ' "   b g c o l o r = " # E 8 E 6 D 0 "   w i d t h = " 1 0 0 % " ' ;  
         s e l e c t   + = ' h e i g h t = " 2 0 0 "   t y p e = " a p p l i c a t i o n / x - s h o c k w a v e - f l a s h " > ' ;  
         s e l e c t   + = ' < / o b j e c t > ' ;  
   }        
   r e t u r n   s e l e c t ;  
 }  
 f u n c t i o n   p a s s w o r d e m a i l e d ( h t m l )  
 {  
 	 v a r   e l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " f l a s h C o n t e n t " ) ;  
 	 e l e m e n t . i n n e r H T M L = h t m l ;  
 	 v a r   r e g = " " ;  
 	 v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " l i s t P r o d u c t s " ) ;  
 	 e l e m e n t 1 . i n n e r H T M L = r e g ;  
 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 d i s p l a y L o g i n ( )  
 	  
 }  
 f u n c t i o n   c h e c k u s e r e m a i l ( h t m l )  
 {  
 	 	   	 v a r   e l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " f l a s h C o n t e n t " ) ;  
 	 	 	 e l e m e n t . i n n e r H T M L = h t m l ;  
 	 	 	 v a r   r e g = d i s p l a y r e g ( ) ;  
 	 	 	 v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " l i s t P r o d u c t s " ) ;  
 	 	 	 e l e m e n t 1 . i n n e r H T M L = r e g ;  
                         $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 }  
 f u n c t i o n   p o p u l a t e T o p S e l l e r s ( )  
 {  
 v a r   h t m l   =   " " ;  
 i f ( T o p S e l l e r s . l e n g t h   ! = 0 )  
 {  
 	 v a r   t m p v a l u e   =   T o p S e l l e r s [ 0 ] . n a m e ;    
 	 v a r   t e m p s e l p   =   n e w   A r r a y ( ) ;  
 	 v a r   t m p i d   =   n e w   A r r a y ( ) ;  
 	 v a r   t m p i s k i t   =   n e w   A r r a y ( ) ;  
 	 f o r ( v a r   l = 0 ; l < T o p S e l l e r s . l e n g t h ; l + + )  
 	 {  
 	 	 t e m p s e l p [ l ]   =   T o p S e l l e r s [ l ] . n a m e ;  
 	 	 t m p i d [ l ]   =   T o p S e l l e r s [ l ] . i d ;  
     	 	 t m p i s k i t [ l ]   =   T o p S e l l e r s [ l ] . I s C o l l e c t i o n ;  
                
 	 }  
 	 t m p v a l u e   =   t e m p s e l p [ 0 ] ; 	  
 	         i f ( ( t e m p s e l p [ 0 ] ! = " N / A " ) & & ( t e m p s e l p [ 0 ] ! = " " ) )  
 	 	 {  
                 	 h t m l + =   ' < l i > < a   h r e f = " j a v a s c r i p t : d i s p l a y S e a r c h e d B o o k s ( ' + t m p i d [ 0 ] + ' , 2 , t h i s . f o r m ) "   c l a s s = " p r o m o P r o d u c t N a m e " > ' + t e m p s e l p [ 0 ] + '   < / a > < / l i > ' ;  
                 }  
  
 	 f o r ( v a r   i = 0 ; i < t e m p s e l p . l e n g t h ; i + + )  
 	 { 	  
                 i f ( ( t m p v a l u e   ! =   t e m p s e l p [ i ] ) & & ( t e m p s e l p [ i ] ! = " N / A " ) & & ( t e m p s e l p [ i ] ! = " " ) )  
 	 	 {  
 	 	   	 h t m l + =   ' < l i > < a   h r e f = " j a v a s c r i p t : d i s p l a y S e a r c h e d B o o k s ( ' + t m p i d [ i ] + ' , 2 , t h i s . f o r m ) "   c l a s s = " p r o m o P r o d u c t N a m e " > ' + t e m p s e l p [ i ] + '   < / a > < / l i > ' ;  
 	 	 }  
 	 	 t m p v a l u e   =   t e m p s e l p [ i ] ;  
 	 }  
 	 r e t u r n   h t m l ;  
         }  
  
 }  
 f u n c t i o n   p o p u l a t e T o p S e l l e r s A u t h o r s ( )  
 {  
 v a r   h t m l   =   " " ;  
 i f ( T o p S e l l e r s A u t h o r s . l e n g t h   ! = 0 )  
 {  
 	  
 	 v a r   t m p v a l u e   =   T o p S e l l e r s A u t h o r s [ 0 ] . n a m e ;   / / e n d   h e r e  
 	 v a r   t e m p s e l p   =   n e w   A r r a y ( ) ;  
 	 v a r   t m p i d   =   n e w   A r r a y ( ) ;  
 	 v a r   t m p i s k i t   =   n e w   A r r a y ( ) ;  
 	 v a r   t m p A u t h o r i d   =   n e w   A r r a y ( ) ;  
  
 	 f o r ( v a r   l = 0 ; l < T o p S e l l e r s A u t h o r s . l e n g t h ; l + + )  
 	 {  
 	 	 t e m p s e l p [ l ]   =   T o p S e l l e r s A u t h o r s [ l ] . n a m e ;  
 	 	 t m p i d [ l ]   =   T o p S e l l e r s A u t h o r s [ l ] . i d ;  
                 t m p i s k i t [ l ]   =   T o p S e l l e r s A u t h o r s [ l ] . I s C o l l e c t i o n ;  
                   t m p A u t h o r i d [ l ] = T o p S e l l e r s A u t h o r s [ l ] . a u t h o r i d ;  
  
                  
 	 }  
 	  
 	 t m p v a l u e   =   t e m p s e l p [ 0 ] ; 	  
 	 h t m l + =   ' < l i > < a   h r e f = " j a v a s c r i p t : d i s p l a y S e a r c h e d B o o k s ( ' + t m p A u t h o r i d [ 0 ] + ' , 1 , t h i s . f o r m ) "   c l a s s = " p r o m o P r o d u c t N a m e "   > ' + t e m p s e l p [ 0 ] + ' < / a > < / l i > ' ;  
  
 	 f o r ( v a r   i = 0 ; i < t e m p s e l p . l e n g t h ; i + + )  
 	 { 	  
 	 	 i f ( t m p v a l u e   ! =   t e m p s e l p [ i ] )  
 	 	 {  
 	 	 	 h t m l + =   ' < l i > < a   h r e f = " j a v a s c r i p t : d i s p l a y S e a r c h e d B o o k s ( ' + t m p A u t h o r i d [ i ] + ' , 1 , t h i s . f o r m ) "   c l a s s = " p r o m o P r o d u c t N a m e " > ' + t e m p s e l p [ i ] + '   < / a > < / l i > ' ;  
  
 	 	 }  
 	 	 t m p v a l u e   =   t e m p s e l p [ i ] ;  
 	 }  
 	 r e t u r n   h t m l ;  
         }  
 }  
  
  
 f u n c t i o n   g e t U R L P a r a m ( s t r P a r a m N a m e )  
 {  
     v a r   s t r R e t u r n   =   " " ;  
     v a r   s t r H r e f   =   w i n d o w . l o c a t i o n . h r e f ;  
     i f   (   s t r H r e f . i n d e x O f ( " & " )   >   - 1   )  
     {  
         v a r   s t r Q u e r y S t r i n g   =   s t r H r e f . s u b s t r ( s t r H r e f . i n d e x O f ( " & " ) ) . t o L o w e r C a s e ( ) ;  
         v a r   a Q u e r y S t r i n g   =   s t r Q u e r y S t r i n g . s p l i t ( " & " ) ;  
         f o r   (   v a r   i P a r a m   =   0 ;   i P a r a m   <   a Q u e r y S t r i n g . l e n g t h ;   i P a r a m + +   )  
         {  
             i f   ( a Q u e r y S t r i n g [ i P a r a m ] . i n d e x O f ( s t r P a r a m N a m e   +   " = " )   >   - 1   )  
 	         {  
                 v a r   a P a r a m   =   a Q u e r y S t r i n g [ i P a r a m ] . s p l i t ( " = " ) ;  
                 s t r R e t u r n   =   a P a r a m [ 1 ] ;  
                 b r e a k ;  
                 }  
             }  
         }  
         r e t u r n   s t r R e t u r n ;  
 }  
 f u n c t i o n   d i s p l a y S e l e c t C o l l e c t i o n I t e m ( i t e m , c o l l e c t i o n )  
 {  
  
 	               v a r   h t m l   = " " ;  
 	               v a r   s t r C r i t e r i a   =   " P r o d u c t s " ;  
                       v a r   t m p = " " ;  
                       i s C o l l e c t i o n = f a l s e ;  
                       v a r   a u t h o r = " " ;  
                         C o l l e c t i o n P r o d u c t   =   c o l l e c t i o n ;  
                       h t m l = ' < f o r m   n a m e = " f r m S e l e c t " >   ' ;  
                       h t m l   + = ' < t a b l e   w i d t h = " 4 5 7 "   b o r d e r = " 0 "   c e l l p a d d i n g = " 4 "   c e l l s p a c i n g = " 0 "   b g c o l o r = " # D 6 D D B D " > ' ;  
                       h t m l   + = ' < t r > ' ;  
 	               h t m l   + = ' < t d > ' ;  
 	               h t m l   + = ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 4 "   b g c o l o r = " # F F F F F F " > ' ;  
                       h t m l   + =   ' < f o r m   n a m e = " f r m S e l e c t " > < t a b l e   w i d t h = " 4 4 0 "   c e l l p a d d i n g = " 3 "   c e l l s p a c i n g = " 0 "   b o r d e r = " 0 "   b g c o l o r = " # D 6 D D B D " > < f o r m   n a m e = " f r m S e l e c t P r o d u c t s "   > ' ;  
                       h t m l + = ' < t r > < t d   c o l s p a n = " 5 " > ' ;  
                       h t m l + =   ' < t a b l e   w i d t h = " 1 0 0 % "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 0 " > ' ;  
 	               h t m l + =   ' < t r > ' ;  
 	               h t m l + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / b g _ t i t l e _ l e f t . g i f "   w i d t h = " 1 0 "   h e i g h t = " 3 7 "   a l t = " " > < / t d > ' ;  
 	               h t m l + =   ' < t d     w i d t h = " 1 0 0 % "     c o l s p a n = " 5 "   a l i g n = " c e n t e r "   b a c k g r o u n d = " g u i / i m g / b g _ t i t l e . g i f "   > < c e n t e r > < h 1   c l a s s = " w h i t e "   > ' + i t e m . n a m e + ' < / c e n t e r > < / h 1 > < / t d > ' ;  
 	               h t m l + = ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / b g _ t i t l e _ r i g h t . g i f "   w i d t h = " 1 0 "   h e i g h t = " 3 7 "   a l t = " " > < / t d > ' ;  
 	               h t m l + =   ' < / t r > < / t a b l e > < / t d > < / t r > < / t a b l e > ' ;  
 	               h t m l   + =   ' < b r / > < t a b l e > ' ;  
 	               f o r ( v a r   i = 0 ; i < C o l l e c t i o n P r o d u c t . l e n g t h ; i + + )  
       	 	 	 {  
 	 	 	         i f ( i t e m . i d = = C o l l e c t i o n P r o d u c t [ i ] . i d )    
         	 	 	 { 	  
         	 	 	 / / c o m m e n t e d   a n d   m o d i f i e d   b y   d e e p i k a   o n   2 8 / 0 4 / 0 9  
 / /                                         h t m l   + =   ' < t r > < t d   a l i g n = " l e f t "   c o l s p a n = " 0 "   c l a s s = " P a g e T e x t " > < s t r o n g > P r i c e : < / s t r o n g > < / t d > < t d > & n b s p ; < s p a n   c l a s s = " P a g e T e x t " > $   ' + C o l l e c t i o n P r o d u c t [ i ] . p r i c e   + '   ( a p p r o x . . . R s . ' + C o l l e c t i o n P r o d u c t [ i ] . p r i c e   *   I N R V a l u e [ 0 ] . v a l u e + ' ) < / s p a n > < / t d > ' ;  
 h t m l   + =   ' < t r > < t d   a l i g n = " l e f t "   c o l s p a n = " 0 "   c l a s s = " P a g e T e x t " > < s t r o n g > P r i c e : < / s t r o n g > < / t d > < t d > & n b s p ; < s p a n   c l a s s = " P a g e T e x t " > $   ' + C o l l e c t i o n P r o d u c t [ i ] . p r i c e   + '   ( a p p r o x . . . R s . ' + ( C o l l e c t i o n P r o d u c t [ i ] . p r i c e   *   I N R V a l u e [ 0 ] . v a l u e ) . t o F i x e d ( 2 ) + ' ) < / s p a n > < / t d > ' ;  
                                          
                                           i f   ( C o l l e c t i o n P r o d u c t [ i ] . d i s c ! = 0 )  
                                           {  
         	                                 h t m l + = ' < t r > < t d   a l i g n = " l e f t "     w i d t h = " 2 5 % "   c o l s p a n = " 0 "   c l a s s = " P a g e T e x t " > < s t r o n g > D i s c o u n t : < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t " > ' + C o l l e c t i o n P r o d u c t [ i ] . d i s c +   ' % < / t d > < / t r > ' ;  
                                           }  
 	                                 h t m l   + =   ' < t r > < t d   w i d t h = " 5 0 % "   > < d i v   i d   = " S i n g l e D i s p l a y B u y " > < a   h r e f = " j a v a s c r i p t : c h e c k b u y ( ' + i t e m . i d + ' , ' + i s C o l l e c t i o n + ' ,   \ ' ' + s t r C r i t e r i a + ' \ ' ) " > < i m g   s r c = " i m a g e s / b u y b u t t o n . g i f "   a l i g n = " l e f t "   a l t = " "   w i d t h = " 1 2 5 "   h e i g h t = " 2 5 "   v s p a c e = " 5 "   b o r d e r = " 0 " > < / a > < / d i v > < / t d > < / t r > ' ;  
 	 	 	 	         f o r ( v a r   j = 0 ; j < C o l l e c t i o n P r o d u c t [ i ] . b o o k s . l e n g t h ; j + + )  
       	 	 	 	         {  
 	                                         v a r   b o o k i d = C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . i d ;  
 	                                         v a r   s t r O p t = " i s f r e e " ;  
                                                 t m p   + =   ' < t r > < t d > < t a b l e > < t r > < t d > ' ;  
                                                 t m p   + =   ' < f o r m   n a m e = " f r m C o l l e c t i o n ' + i + ' "   m e t h o d = " p o s t "   > ' ;  
                                                 t m p   + =   ' < t a b l e     a l i g n = " t o p "   c l a s s = " l i s t T a b l e "   w i d t h = " 0 "       b o r d e r = " 0 "     c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 0 "   > ' ;  
 	                                         t m p   + =   ' < t r   v a l i g n = " t o p " > ' ;  
 	                                         t m p   + =   ' < t d   a l i g n = " t o p " > ' ;  
 	                                         t m p   + =   ' < i m g   s r c = " ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . t h u m b + ' " a l t = " ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . n a m e + ' "   b o r d e r = " 1 % " > < / t d > ' ;  
                                                 t m p   + =   ' < / t r > '  
 	 	                                 t m p   + =   ' < / t a b l e > < / f o r m > < / t d > ' ;  
 	 	                                 t m p   + =   ' < t d > < t a b l e   b r o d e r   = " 2 " > ' ;  
 	 	                                 i f ( C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . P r o d u c t C a t e g o r y I D   = =   1 )  
 	 	                                 {  
 	 	                                         i f   ( C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r ! =   " N / A " )  
                                                         {  
                                                           i f   ( C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r D e s c r i p t i o n ! = " " )  
                                                           {  
                                                               a u t h o r = ' < t a b l e > < t r > < t d   a l i g n = " l e f t "   w i d t h = " 3 0 % " > < i m g   h e i g h t = " 1 0 0 "   w i d t h = " 1 0 0 "   s r c = ' +   C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r I m a g e   + '   a l t = " A u t h o r   I m a g e "   / > < / t d > < t d   a l i g n = " l e f t "   v a l i g n = " t o p "   w i d t h = " 7 0 % " > < f o n t   s i z e = " 2 " > < d i v   i d = " L o a d D e s c r i p t i o n "   > < / d i v > < / t d > < / t r > < / t a b l e > ' ;  
                                                               v a r   d e s c = C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r D e s c r i p t i o n ;  
                                                              
                                                               v a r   a t t r i b u t e =   d e s c . s u b s t r ( 0 ,   d e s c . i n d e x O f ( " . " ,   0 ) ) ;  
                                                             $ ( ' p o p u p B o d y ' ) . i n n e r H T M L = a u t h o r ;  
 	                                                     c l i e n t S i d e I n c l u d e ( " L o a d D e s c r i p t i o n " ,   " a d m i n / P a g e C o n t e n t / A u t h o r / " +   a t t r i b u t e   + " / " +   d e s c ) ;  
                                                                           }      
                                                                           / / c o m m e n t e d   a n d   a d d e d   b y   g e e t h a   f r o m   s a r a s w a t h y   o n   2 5 / 0 3 / 2 0 0 9  
                                                                 / / t m p   + =   ' < t r > < t d   a l i g n = " l e f t "   c l a s s = " P a g e T e x t " > < s t r o n g > †š¿°¿¯°Í: < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t "     o n m o u s e o v e r = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   o n m o u s e o u t = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   s t y l e = " c u r s o r :   p o i n t e r ; " > < a   h r e f = " j a v a s c r i p t : d i s p l a y S e a r c h e d B o o k s ( ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r I D + ' , 1 , t h i s . f o r m ) "     > < f o n t   c o l o r = " B l u e " > ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r + ' < / f o n t > < / a > < / t d > < / t r > ' ;  
                                                                 t m p   + =   ' < t r > < t d   a l i g n = " l e f t "   c l a s s = " P a g e T e x t " > < s t r o n g > †š¿°¿¯°Í: < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t "     o n m o u s e o v e r = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   o n m o u s e o u t = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   s t y l e = " c u r s o r :   p o i n t e r ; " > < a   h r e f = " j a v a s c r i p t : f u n D i s p l a y S e a r c h e d B o o k s ( 0 , \ ' f u n D i s p l a y S e a r c h e d B o o k s \ ' , ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r I D + ' , 1 , \ ' ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r + ' \ ' ) "     > < f o n t   c o l o r = " B l u e " > ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . A u t h o r + ' < / f o n t > < / a > < / t d > < / t r > ' ;  
                                                                     / /   e n d e d   h e r e  
 	 	                                         }  
 	 	                                 }  
 	 	                                 e l s e  
 	 	                                 {  
 	 	                                         i f   ( C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . E d i t o r ! =   " N / A " )  
                                                         {  
                                                                 / / c o m m e n t e d   a n d   m o d i f i e d   b y   g e e t h a   f r o m   s a r a s w a t h y   o n   2 5 / 0 3 / 2 0 0 9  
                                                                 / / t m p   + =   ' < t r > < t d   a l i g n = " l e f t "   c l a s s = " P a g e T e x t "   > < s t r o n g > †š¿°¿¯°Í: < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t "   o n m o u s e o v e r = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   o n m o u s e o u t = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   s t y l e = " c u r s o r :   p o i n t e r ; "   > < a   h r e f = " j a v a s c r i p t : d i s p l a y S e a r c h e d B o o k s ( ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . E d i t o r I D + ' , 3 , t h i s . f o r m ) "     > < f o n t   c o l o r = " B l u e " > ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . E d i t o r + ' < / f o n t > < / a > < / t d > < / t r > ' ;  
                                                                 t m p   + =   ' < t r > < t d   a l i g n = " l e f t "   c l a s s = " P a g e T e x t "   > < s t r o n g > †š¿°¿¯°Í: < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t "   o n m o u s e o v e r = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   o n m o u s e o u t = " j a v a s c r i p t : p o p U p A u t h o r ( ) "   s t y l e = " c u r s o r :   p o i n t e r ; "   > < a   h r e f = " j a v a s c r i p t : f u n D i s p l a y S e a r c h e d B o o k s ( 0 , \ ' f u n D i s p l a y S e a r c h e d B o o k s \ ' , ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . E d i t o r I D + ' , 3 , \ ' ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . E d i t o r + ' \ ' ) " "     > < f o n t   c o l o r = " B l u e " > ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . E d i t o r + ' < / f o n t > < / a > < / t d > < / t r > ' ;  
                                                               / / e n d s   h e r e  
         	                                         }  
         	                                 }  
                                                 i f   ( C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . P u b l i s h e r ! =   " N / A " )  
                                                 {  
                                                         t m p   + =   ' < t r > < t d   a l i g n = " l e f t "   c l a s s = " P a g e T e x t " > < s t r o n g > ª¤¿ªÍª¾³°Í: < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t " > ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . P u b l i s h e r + ' < / t d > < / t r > ' ;  
                                                 }  
                                                 t m p   + = ' < t r > < t d   a l i g n = " l e f t "     w i d t h = " 2 5 % "   c o l s p a n = " 0 "   c l a s s = " P a g e T e x t " > < s t r o n g > S i z e : < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t " > ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . S i z e   +   ' < / t d > ' ;  
                                          
                                                 i f ( C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . S a m p l e s ! = " N / A " )  
                                                 {  
                                                       t m p + =   ' < t d   c o l s p a n = 2   a l i g n = " l e f t "   c l a s s = " P a g e T e x t " > < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < a   h r e f = " ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . S a m p l e s + ' "   > < f o n t   c o l o r = " b l u e " > V i e w   S a m p l e   P a g e s < / f o n t > < / a > < / s p a n > < b r > < / t d > < / t r > ' ;  
                                                 }  
 	                                         t m p   + = ' < t r > < t d   a l i g n = " l e f t "     w i d t h = " 2 5 % "   c o l s p a n = " 0 "   c l a s s = " P a g e T e x t " > < s t r o n g > ®Ê. ª•Í•®Í: < / s t r o n g > < / t d > < t d   c l a s s = " P a g e T e x t " > ' + C o l l e c t i o n P r o d u c t [ i ] . b o o k s [ j ] . N o O f P a g e s   +   ' < / t d > < / t r > ' ;  
 	                 	                 t m p   + =   ' < t r > < t d   c o l s p a n = " 2 " > < d i v   i d = " i n c l u d e o n e ' + j + ' "   c l a s s = " p r o m o P r o d u c t D e s c " > < / d i v > < / t d > < / t r > < / t a b l e > < / t d > ' ;      
 	 	 	                         t m p + = ' < t r > < / t a b l e > < / t d > < / t r > ' ;  
         	                         }  
 	 	                 }  
 	   	         }  
 	   	 	        
 	   	         h t m l   + = ' < / t a b l e > < / f o r m > ' ;  
 	   	         h t m l + = ' < t r   a l i g n = " c e n t e r " > ' + t m p ;  
 	   	         / / C o d e   a d d e d   a n d   m o d i f y   b y     s e n t h i l   g i v e n   b y   r a n j i t h   J   o n   1 5 0 9 0 9  
 	                 h t m l + = ' < / t r > ' ;  
 	                 h t m l   + = ' < t r > < t d > ' ;  
 	                 h t m l + = ' < t a b l e   w i d t h = " 1 0 0 % "   h e i g h t = " 3 2 0 p x "     b g c o l o r = " # D 6 D D B D " > ' ;  
                         h t m l + = ' < t r   v a l i g n = " t o p " > < t d   a l i g n = " c e n t e r " > ' ;  
                         h t m l + = ' < t a b l e > < t r > < t d   a l i g n = " c e n t e r " > < F O N T   c o l o r = # C C 6 6 0 0 > < b > µ¿®°Íš©™Í•³Í< / b > < / f o n t > < / t d > < / t r > ' ;  
                         h t m l + = ' < t r > < t d   a l i g n = " l e f t "   w i d t h =   " 1 0 0 % "   c l a s s = " p r o m o P r o d u c t D e s c " > < F O N T   c o l o r = # C C 6 6 0 0 > ‰™Í•³Í  µ¿®°Íš©™Í•³Í  µ°µÇ±Í•ªÍªŸÁ•¿©Í±©< / f o n t > < / t d > < / t r > ' ;  
                         h t m l + = ' < / t a b l e > < / t d > < / t r > ' ;  
  
                         h t m l + = ' < t r   s t y l e = " h e i g h t : 2 8 0 p x "   v a l i g n = " t o p " > < t d   a l i g n = " l e f t "   v a l i g n = " t o p " > ' ;  
  
                           h t m l + = ' < d i v   s t y l e = " o v e r f l o w :   a u t o ;   w i d t h : 1 0 0 % ; h e i g h t : 2 5 0 p x ; p o s i t i o n : a b s o l u t e ;   b o r d e r :   t h i n   s o l i d   # F F F F 0 0 " > < t a b l e > ' ;  
                         h t m l + = ' < t r > < t d > < t a b l e   c l a s s = " p r o m o P r o d u c t D e s c " > ' ;  
                         f o r   ( v a r   i = 0 ;   i < B o o k R e v i e w . l e n g t h ;   i + + )  
                           {  
                           i f ( B o o k R e v i e w [ i ] . i d   = =   i t e m . i d )  
   	                       {  
                                     h t m l + = ' < t r > < t d   a l i g n = " l e f t " > < b > N a m e   : < / b > < / t d > < t d > ' +   B o o k R e v i e w [ i ] . U s e r n a m e   + ' < / t d > ' ;  
                                     h t m l + = ' < t r > < t d   a l i g n = " l e f t " > < b > C o u n t r y   : < / b > < / t d > < t d > ' +   B o o k R e v i e w [ i ] . C o u n t r y   + ' < / t d > < / t r > ' ;  
                                     h t m l + = ' < t r > < t d   a l i g n = " l e f t " > < b > C o m m e n t   : < / b > < / t d > < t d > ' +   B o o k R e v i e w [ i ] . C o m m e n t s   + ' < / t d > < / t r > ' ;  
                                     h t m l + = ' < t r > < t d > < i m g   a l t = " "   h e i g h t = " 3 "   s r c = " i m a g e s / s p a c e r . g i f "   w i d t h = " 1 0 0 % "   a l i g n = " m i d d l e "   / > < / t d > < / t r > ' ;  
                         }  
                         } 	   	           	  
  
                     / / E n d   h e r e   R A N J I T H   o n   1 5 / 0 9 / 2 0 0 9  
  
 	         h t m l + = ' < / t r > < / t a b l e > < / t d > < / t r > < / t a b l e > < / f o r m > ' ;  
 	   	 h t m l   + = ' < / t a b l e > < / f o r m > ' ;  
 	 	 h t m l   + =   ' < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 " > < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 " > ' ;  
 	       	 h t m l   + =   ' < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 " > < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 " > ' ;  
         	 $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	         f o r ( v a r   c = 0 ; c < C o l l e c t i o n P r o d u c t . l e n g t h ; c + + )  
 	         { 	      
 	 	       i f ( i t e m . i d = = C o l l e c t i o n P r o d u c t [ c ] . i d )    
         	       { 	  
         	                 f o r ( v a r   k = 0 ; k < C o l l e c t i o n P r o d u c t [ c ] . b o o k s . l e n g t h ; k + + )  
       	 	 	 	 {  
                                       v a r   b o o k i d = C o l l e c t i o n P r o d u c t [ c ] . b o o k s [ k ] . i d ;  
 	                               c l i e n t S i d e I n c l u d e ( " i n c l u d e o n e " + k , " a d m i n / P a g e C o n t e n t / P r o d u c t s / " + b o o k i d + " / " + C o l l e c t i o n P r o d u c t [ c ] . b o o k s [ k ] . L o n g D e s c r i p t i o n ) ;  
 	                         }  
 	               }  
               }  
 	       i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g L o g i n F a i l e d ' ) | | (   C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' U n A p p r o v e d ' ) )        
               {    
                 v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	 $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	       }  
 }  
 f u n c t i o n   v i e w s a m p l e s ( i t e m i d )  
 {  
 	 v a r   h t m l = ' < f o r m   n a m e = " f o r m 1 " >   ' ;  
 	 d i r e c t b u y = " f a l s e " ;  
 	 f l a v t m p   =   " S e l e c t "   ;  
 	 s i z e t m p   =   " S e l e c t " ;  
 	 h t m l   + = ' < t a b l e   w i d t h = " 4 5 7 "   b o r d e r = " 0 "   c e l l p a d d i n g = " 4 "   c e l l s p a c i n g = " 0 "   > ' ;  
 	 h t m l   + = ' < t r > ' ;  
 	 h t m l   + = ' < t d > ' ;  
         h t m l   + = ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 4 "   > ' ;  
 	 v a r   t m p = " " ;  
 	 v a r   B o o k I n d e x = 0 ;  
 	 f o r ( v a r   i = 0 ; i < S e l e c t e d P r o d u c t s . l e n g t h ; i + + )  
 	 {  
 	 	 i f ( ( S e l e c t e d P r o d u c t s [ i ] . i d   = =   i t e m i d ) & & ( S e l e c t e d P r o d u c t s [ i ] . P r o d u c t C a t e g o r y I D = = 1 ) )  
 	 	 {  
 	 	         B o o k I n d e x = i ;  
 	 	    
 	 	 }  
         }  
         h t m l + = ' < t r > < t d   w i d t h = " 0 % "   a l i g n = " c e n t e r " > < s t r o n g > < f o n t   c o l o r = " # 8 B 0 0 0 0 "   s i z e = " 3 " > V i e w   S a m p l e s < / f o n t > < / s t r o n g > < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 0 "   h e i g h t = " 0 "   / > < / t d > ' ;  
 	 h t m l + = ' < / t r > ' ;  
         h t m l + = ' < / t r > < b r > < b r > < b r > ' ;  
         h t m l + =   ' < t d   a l i g n = " c e n t e r " > ' ;  
         h t m l   + =   ' < i m g   s r c = " ' + S e l e c t e d P r o d u c t s [ B o o k I n d e x ] . S a m p l e s + ' " a l t = " ' + S e l e c t e d P r o d u c t s [ B o o k I n d e x ] . n a m e + ' "   b o r d e r = " 1 % " > ' ;  
         h t m l   + =   ' < / a > < / t d > < / t r > < t r > < t d > & n b s p < / t d > < / t r > < t r > < t d   a l i g n = " c e n t e r " > ' ;  
         h t m l   + =   ' < a   h r e f = " # "   c l a s s = " p r o m o P r o d u c t N a m e " > ' + S e l e c t e d P r o d u c t s [ B o o k I n d e x ] . n a m e + ' < / a > < b r > ' ;  
         h t m l   + =   ' < / t d > ' ;  
 	 h t m l + = ' < / t r > < / t a b l e > < / t d > < / t r > < / t a b l e > < / f o r m > ' ;  
 	 h t m l   + = ' < t a b l e   a l i g n = " l e f t "   w i d t h = " 4 0 0 " > < t r > < t d > < I N P U T   t y p e = " b u t t o n "   s t y l e = " w i d t h : 1 5 % "   a l t = " C l e a r   V a l u e s "     s r c = " g u i / i m g / b t _ c a n c e l o r d e r . g i f "   v a l u e = " G o   B a c k "   o n C l i c k = " r e t u r n   d i s p l a y S e l e c t e d I t e m ( ' + i t e m i d + ' ) " > < / t d > < / t r > < / t a b l e > ' ;  
 	 v a r   e l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " f l a s h C o n t e n t " ) ;  
 	 e l e m e n t . i n n e r H T M L = h t m l ;  
 	 v a r   r o w   = " "   ;  
 	 v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " l i s t P r o d u c t s " ) ;  
 	 e l e m e n t 1 . i n n e r H T M L = r o w ;  
         $ ( ' d e a l h e a d ' ) . i n n e r H T M L = " " ;  
         c l i e n t S i d e I n c l u d e ( " i n c l u d e o n e " ,   " a d m i n / P a g e C o n t e n t / P r o d u c t s / " + i t e m i d + " / " + i t e m i d + " . h t m l " ) ;  
 } 	  
 f u n c t i o n   d i s p l a y R e v i e w ( i t e m i d )  
 {  
     i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) )  
 	 {  
 	 	   v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	   v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	           h t m l   + =   ' < t r > ' ;  
 	 	   h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
 	 	   h t m l   + =   ' < / t r > ' ;  
                   h t m l   + =   ' < / t a b l e > ' ;  
                   h t m l   + =   ' < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < c e n t e r > < b > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; P l e a s e   l o g   o n   i f   y o u   a r e   r e g i s t e r e d   u s e r   o r   r e g i s t e r   a n d   l o g   i n .   < / f o n t > < / b > < / c e n t e r > < / s p a n > ' ;  
                   $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	   $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   w i n d o w . s c r o l l T o ( 0 , 0 ) ;  
                   w i n d o w . f o c u s ( ) ;  
 	           r e t u r n ;    
 	           }  
 e l s e { 	            
                   v a r   r e g =   ' < f o r m   n a m e = " f r m R e v i e w s "   m e t h o d = " p o s t "   a c t i o n = " R e v i e w s " > < b r > ' ;  
                   r e g   + =   " < t a b l e     c e l l p a d d i n g = ' 0 '   c e l l s p a c i n g = ' 0 '   b o r d e r = ' 0 '   w i d t h = ' 1 0 0 % '   > " ;  
 	           r e g + = ' < t r > < t d   a l i g n = " c e n t e r "   b g c o l o r = " # F F F a F 0 "   > ' ;  
                   r e g + = ' < f o n t   c o l o r = # C C 6 6 0 0   f a c e = " A r i a l " > < s t r o n g > < f o n t   s i z e = " 5 " > < b > µ¿®°Íš©™Í•³Í< / b >   ' ;        
                   r e g + = ' < / f o n t >   < / s t r o n g > < / f o n t > < / t d > < / t r > < t r > < t d > < b r / > < / t d > < / t r > ' ;  
                   r e g + = ' < t r > < t d   a l i g n = " c e n t e r " > < f o n t   c o l o r = # C C 6 6 0 0   f a c e = " A r i a l " > < s t r o n g > < f o n t   s i z e = " 3 " > < b > ‰™Í•³Í  µ¿®°Íš©™Í•³Í  µ°µÇ±Í•ªÍªŸÁ•¿©Í±©< / b > ' ;  
                   r e g + = ' < / f o n t >   < / s t r o n g > < / f o n t > < / t d > < / t r > < b r / > < / t a b l e > ' ;  
                   r e g + = ' < b r   / > < b r   / > < t r > < / t r > < t r > < t d   c l a s s = " P a g e T e x t "   a l i g n = " c e n t e r " > < f o n t   s i z e = " 2 " > < s t r o n g > C o m m e n t   : < / f o n t >   < / s t r o n g > < / t d > & n b s p ; & n b s p ; & n b s p ; ' ;  
 	           r e g + = ' < t d >   < t e x t a r e a   n a m e = " t x t c o m m e n t "   s t y l e = " W I D T H :   2 5 0 p x ;   H E I G H T :   1 0 0 p x "   >   ' ;  
                   r e g   + =   ' < / t e x t a r e a > < / t d > ' ;  
                   r e g + = ' < / t r > ' ;    
                   r e g   + = '   < t r > < / t r > ' ;  
                   r e g   + = " < / t a b l e > " ;  
                   r e g   + = ' < t a b l e   a l i g n = " c e n t e r " > < t r   a l i g n = " c e n t e r " > < / b r > < / b r > < t d > < t d > < / t d > < t d > < / t d > < t d > ' ;  
                   r e g   + = ' < i n p u t   t y p e = " b u t t o n "   n a m e = " b t n s u b m i t "   v a l u e = " S u b m i t "   o n c l i c k = " r e t u r n   V a l i d a t i o n R e v i e w s ( t h i s . f o r m , ' +   i t e m i d   + ' ) ; "   s t y l e = " f l o a t :   r i g h t ;   w i d t h :   9 7 p x ;   m a r g i n - l e f t :   2 p x ;   h e i g h t :   2 3 p x ; " / > < / t d > ' ;  
                   / / C o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   o n   2 4 / 0 3 / 2 0 0 9  
                   / / r e g   + = ' < t d   > < i n p u t   t y p e = " b u t t o n "   n a m e = " b t n b a c k "   v a l u e =   " B a c k "   O n C l i c k = " r e t u r n   d i s p l a y P r o d u c t P a g e s ( 0 ) ; " s t y l e = " f l o a t :   r i g h t ;   w i d t h :   9 7 p x ;   m a r g i n - l e f t :   2 p x ;   h e i g h t :   2 3 p x ; " / > < / t d > < / t r > ' ;                            
                   r e g   + = ' < t d   > < i n p u t   t y p e = " b u t t o n "   n a m e = " b t n b a c k "   v a l u e =   " B a c k "   O n C l i c k = " r e t u r n   d i s p l a y P r o d u c t P a g e s ( 0 , \ ' d i s p l a y P r o d u c t P a g e s \ ' ) ; " s t y l e = " f l o a t :   r i g h t ;   w i d t h :   9 7 p x ;   m a r g i n - l e f t :   2 p x ;   h e i g h t :   2 3 p x ; " / > < / t d > < / t r > ' ;                            
                   r e g   + = " < / t a b l e > < / f o r m > " ;  
 	           r e g   + =   ' < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 " > < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 " > ' ;  
 	 	   r e g   + =   ' < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 "   > < i m g   s r c = " i m a g e s / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 "   h e i g h t = " 5 0 " > ' ;  
             / / c o d e   c o m m e n t   b y   b h a r a t h i   o n   2 1 / 0 3 / 0 9   f o r   t h e   p u r p o s e   o f   s h o u l d   n o t   s h o w   t h e   m e s s a g e   i n   s u b m i t   b u t t o n   c l i c k e d  
 / /           i f ( ( B o o k R e v i e w . l e n g t h ! = 0 ) )  
 / / 	 {  
 / /   	     f o r ( v a r   i = 0 ;   i < B o o k R e v i e w . l e n g t h ;   i + + )  
 / /   	     {  
 / /         	         i f ( B o o k R e v i e w [ i ] . i d = = i t e m i d )  
 / /   	                 {  
 / /   	                         r e g   + = " < t r > < t d > " + B o o k R e v i e w [ i ] . C o m m e n t s + " < / t d > < / t r > < / b r > " ;  
 / /   	                 }  
 / /   	     }  
 / / 	 }  
 / / e n d   h e r e   b h a r a t h i   o n   2 1 / 0 3 / 0 9  
  
         $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   r e g ;  
         $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
         $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 d o c u m e n t . f r m R e v i e w s . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
 	 d o c u m e n t . g e t E l e m e n t B y I d ( " t x t c o m m e n t " ) . f o c u s ( ) ;  
 	  
 	 	 }  
 	  
 }  
  
 f u n c t i o n   V a l i d a t i o n R e v i e w s ( f r m , b o o k i d )  
   {  
         i f ( d o c u m e n t . f r m R e v i e w s . e l e m e n t s [ 0 ] . v a l u e   = = "   " )  
 	 {  
 	 	 a l e r t ( " P l e a s e   E n t e r   a   V a l u e " ) ;  
 	 	 r e t u r n   w i n d o w . d o c u m e n t . f r m R e v i e w s . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
 	 }  
 	 e l s e  
 	 {  
                 f r m . b t n s u b m i t . d i s a b l e d = " d i s a b l e d " ; 	  
 	 	 r e t u r n   D o w n l o a d ( f r m , b o o k i d )  
 	 }  
        
   }  
 f u n c t i o n   f u n c R e a d e r d o w n l o a d ( ) {  
   i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) )  
 	 {  
 	 	   v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	   v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	           h t m l   + =   ' < t r > ' ;  
 	 	   h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
 	 	   h t m l   + =   ' < / t r > ' ;  
                   h t m l   + =   ' < / t a b l e > ' ;  
                   h t m l   + =   ' < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < c e n t e r > < b > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; P l e a s e   l o g   o n   i f   y o u   a r e   r e g i s t e r e d   u s e r   o r   r e g i s t e r   a n d   l o g   i n .   < / f o n t > < / b > < / c e n t e r > < / s p a n > ' ;  
                     v a r   r o w 1   = " "   ;  
                     v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t h a n k s " ) ;  
 	             e l e m e n t 1 . i n n e r H T M L = r o w 1 ;  
                   $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	   $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   S e t F o c u s ( ) ;  
 	           r e t u r n ;    
 	           }  
 	             e l s e   i f ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' )  
 	           {  
 	             v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	     v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	           h t m l   + =   ' < t r > ' ;  
 	 	   h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
 	 	   h t m l   + =   ' < / t r > ' ;  
                   h t m l   + =   ' < / t a b l e > ' ;  
                   h t m l   + =   ' < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < c e n t e r > < b > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; P l e a s e   l o g   i n   a n d   C l i c k   d o w n l o a d s .   < / f o n t > < / b > < / c e n t e r > < / s p a n > ' ;  
                   $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	   $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   S e t F o c u s ( ) ;  
 	           r e t u r n ;    
 	           }  
 	           e l s e  
 	           {  
                        
                         v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	                 h t m l   + =   ' < t r > ' ;  
 	 	         h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
         	 	 h t m l   + =   ' < / t r > ' ;  
                         h t m l   + =   ' < / t a b l e > ' ;  
                                                  
                             i f   ( C u s t [ 0 ] . M a c I D = = t r u e )  
                               {  
                                             h t m l   + =   ' < s p a n   c l a s s = " h e a d e r t e x t " > < c e n t e r > S P R e a d e r   D o w n l o a d < / c e n t e r > < / s p a n > ' ;      
                                             h t m l   + =   " < f o r m   n a m e = ' f r m R e a d e r '   m e t h o d = ' p o s t '   a c t i o n   =   ' D o w n l o a d R e a d e r ' > " ;  
                                               h t m l   + = " < t a b l e   > < t r > < t d   c o l s p a n = ' 1 2 '   a l i g n = ' r i g h t '   c l a s s = ' P a g e T i t l e ' > < i n p u t   t y p e = ' c h e c k b o x '   n a m e = ' c h k R e a d A g r e e '   v a l u e = ' 1 ' > I   A g r e e   < a   h r e f = ' a d m i n / p a g e s / T e r m s C o n d i t i o n s R e a d e r . h t m l '   t a r g e t = ' _ b l a n k ' >   < f o n t   c o l o r = ' b l u e ' > T e r m s   &   C o n d i t i o n s < / f o n t > < / a > < / t d > < / t r > " ;  
                                             h t m l   + =   ' < t r > < t d > & n b s p ; < / t d > < / t r > < t r > < t d   a l i g n = " c e n t e r " > < i n p u t   t y p e = " b u t t o n "   v a l u e = " D o w n l o a d "   o n c l i c k = "   r e t u r n     c h e c k C h e c k B o x e s ( t h i s . f o r m ) "   i d = " B u t t o n 1 " / > ' ;          
                                 }  
                               e l s e  
                               {  
                                         h t m l   + =   ' < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < s p a n   c l a s s = " P a g e T e x t " > < c e n t e r > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > < b > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ;   P l e a s e   d o w n l o a d   t h e   S a n g a p a l a g a i   R e g i s t e r ,   s a v e   a n d   r u n .   < / b r > < / b r > < / b > < / c e n t e r > < / s p a n > ' ;  
                                         h t m l   + =   " < f o r m   n a m e = ' f r m S a n g a p a l a g a i R e g i s t e r '   m e t h o d = ' p o s t '   a c t i o n   =   ' D o w n l o a d R e g i s t e r ' > " ;  
                                         h t m l   + =   ' < c e n t e r > < i n p u t   t y p e = " b u t t o n "   v a l u e = " R e g i s t e r "   o n c l i c k = "   r e t u r n   D o w n l o a d ( t h i s . f o r m ) "   i d = " B u t t o n 1 " / > ' ;  
                               }  
                                   h t m l   + = ' & n b s p ; < I N P U T   t y p e = " b u t t o n "   a l t = " C l e a r   V a l u e s "   v a l u e = " G o   B a c k "   O n C l i c k = " j a v a s c r i p t : m y A c c o u n t u s e r ( ) " > < / t d > < / t r > < / t a b l e > < / f o r m > < / c e n t e r > ' ;  
 	 	 	     v a r   r o w   = " "   ;  
 	                     v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " l i s t P r o d u c t s " ) ;  
 	                     e l e m e n t 1 . i n n e r H T M L = r o w ;  
                         $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	         $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	 }  
                          
 }  
  
 f u n c t i o n   f u n c R e g i s t e r d o w n l o a d ( ) {  
   i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) )  
 	 {  
 	 	   v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	   v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	           h t m l   + =   ' < t r > ' ;  
 	 	   h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
 	 	   h t m l   + =   ' < / t r > ' ;  
                   h t m l   + =   ' < / t a b l e > ' ;  
                   h t m l   + =   ' < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < c e n t e r > < b > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; P l e a s e   l o g   o n   i f   y o u   a r e   r e g i s t e r e d   u s e r   o r   r e g i s t e r   a n d   l o g   i n .   < / f o n t > < / b > < / c e n t e r > < / s p a n > ' ;  
                     v a r   r o w 1   = " "   ;  
                     v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t h a n k s " ) ;  
 	             e l e m e n t 1 . i n n e r H T M L = r o w 1 ;  
                   $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	   $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   S e t F o c u s ( ) ;  
 	           r e t u r n ;    
 	           }  
 	             e l s e   i f ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' )  
 	           {  
 	             v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	     v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	           h t m l   + =   ' < t r > ' ;  
 	 	   h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
 	 	   h t m l   + =   ' < / t r > ' ;  
                   h t m l   + =   ' < / t a b l e > ' ;  
                   h t m l   + =   ' < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < c e n t e r > < b > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; P l e a s e   l o g   i n   a n d   C l i c k   d o w n l o a d s .   < / f o n t > < / b > < / c e n t e r > < / s p a n > ' ;  
                   $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	   $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	   $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   S e t F o c u s ( ) ;  
 	           r e t u r n ;    
 	           }  
 	           e l s e  
 	           {  
                        
                         v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	                 h t m l   + =   ' < t r > ' ;  
 	 	         h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
         	 	 h t m l   + =   ' < / t r > ' ;  
                         h t m l   + =   ' < / t a b l e > ' ;  
                                                  
 / /                             i f   ( C u s t [ 0 ] . M a c I D = = t r u e )  
 / /                               {  
 / /                                             h t m l   + =   ' < s p a n   c l a s s = " h e a d e r t e x t " > < c e n t e r > S P R e a d e r   D o w n l o a d < / c e n t e r > < / s p a n > ' ;      
 / /                                             h t m l   + =   " < f o r m   n a m e = ' f r m R e a d e r '   m e t h o d = ' p o s t '   a c t i o n   =   ' D o w n l o a d R e a d e r ' > " ;  
 / /                                               h t m l   + = " < t a b l e   > < t r > < t d   c o l s p a n = ' 1 2 '   a l i g n = ' r i g h t '   c l a s s = ' P a g e T i t l e ' > < i n p u t   t y p e = ' c h e c k b o x '   n a m e = ' c h k R e a d A g r e e '   v a l u e = ' 1 ' > I   A g r e e   < a   h r e f = ' a d m i n / p a g e s / T e r m s C o n d i t i o n s R e a d e r . h t m l '   t a r g e t = ' _ b l a n k ' >   < f o n t   c o l o r = ' b l u e ' > T e r m s   &   C o n d i t i o n s < / f o n t > < / a > < / t d > < / t r > " ;  
 / /                                             h t m l   + =   ' < t r > < t d > & n b s p ; < / t d > < / t r > < t r > < t d   a l i g n = " c e n t e r " > < i n p u t   t y p e = " b u t t o n "   v a l u e = " D o w n l o a d "   o n c l i c k = "   r e t u r n     c h e c k C h e c k B o x e s ( t h i s . f o r m ) "   i d = " B u t t o n 1 " / > ' ;          
 / /                                 }  
 / /                               e l s e  
 / /                               {  
                                         / / h t m l   + =   ' < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < s p a n   c l a s s = " P a g e T e x t " > < c e n t e r > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > < b > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ;   P l e a s e   d o w n l o a d   t h e   S a n g a p a l a g a i   R e g i s t e r ,   s a v e   a n d   r u n .   < / b r > < / b r > < / b > < / c e n t e r > < / s p a n > ' ;  
                                         h t m l   + =   ' < b r / > < b r / > < b r / > < s p a n   c l a s s = " P a g e T e x t " > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > < p > P l e a s e   D o w n l o a d   t h e   2 n d   S y s t e m   R e - R e g i s t e r   a n d   R u n   &   S u b m i t   I t . < / b r > I t   w i l l   t a k e   y o u   t o   2 n d   S P   R e a d e r   D o w n l o a d . < / p > ' ;  
                                           h t m l   + =   ' < p > A f t e r   D o w n l o a d i n g   t h e   2 n d   S P   R e a d e r ,     L o g   o u t   a n d   L o g   i n   w i t h   y o u r   u s e r   n a m e   &   p a s s w o r d   a n d   g o   t o   y o u r   m y a c c o u n t   /   m y l i b r a r y     &   d o w n l o a d   y o u r   2 n d   S y s t e m   D o w n l o a d   B o o k   /   M a g a z i n e . < / p >   ' ;  
                                           / / C o d e   a d d e d   b y   s e n t h i l   o n   1 6 / 0 3 / 2 0 1 0   f o r   a d d e d   t e x t   c h a n g e s  
                                             h t m l   + =   ' < p > U s e   I n t e r n e t   E x p l o r e r   B r o w s e r < / p > ' ;  
                                             / / E n d   h e r e   s e n t h i l   o n   1 6 / 0 3 / 2 0 1 0  
                                           h t m l   + =   ' < p > I f   y o u   n e e d   a n y   a s s i s t a n c e   p l e a s e   w r i t e   t o     < / f o n t > < a   h r e f = " m a i l t o : s a n g a p a l a g a i @ g m a i l . c o m " > < f o n t   c o l o r = " b l u e " > s a n g a p a l a g a i @ g m a i l . c o m < / f o n t > < / a > < / p > < / b r > < / s p a n > ' ;                                            
                                         h t m l   + =   " < f o r m   n a m e = ' f r m S a n g a p a l a g a i R e g i s t e r '   m e t h o d = ' p o s t '   a c t i o n   =   ' D o w n l o a d R e g i s t e r ' > " ;  
                                         h t m l   + =   ' < c e n t e r > < i n p u t   t y p e = " b u t t o n "   v a l u e = " R e - R e g i s t e r "   o n c l i c k = "   r e t u r n   D o w n l o a d ( t h i s . f o r m ) "   i d = " B u t t o n 1 " / > ' ;  
                               / / }  
                                   h t m l   + = ' & n b s p ; < I N P U T   t y p e = " b u t t o n "   a l t = " C l e a r   V a l u e s "   v a l u e = " G o   B a c k "   O n C l i c k = " j a v a s c r i p t : m y A c c o u n t u s e r ( ) " > < / t d > < / t r > < / t a b l e > < / f o r m > < / c e n t e r > ' ;  
 	 	 	     v a r   r o w   = " "   ;  
 	                     v a r   e l e m e n t 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( " l i s t P r o d u c t s " ) ;  
 	                     e l e m e n t 1 . i n n e r H T M L = r o w ;  
                         $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
 	 	         $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	 }  
                          
 }  
 f u n c t i o n   d i s p l a y W i n d o w ( )  
 	 	         {  
 	 	                 v a r   w ,   h ,   l ,   t ;  
 	 	                 w   =   4 0 0 ;  
 	 	                 h   =   2 0 0 ;  
                                 l   =   3 0 0 ;  
 	 	                 t   =   3 5 0 ;  
 	 	                   v a r   h t m l = " " ;  
 	 	                 h t m l   + =   " < f o r m   n a m e   = ' P a y p a l f o r m ' > < t a b l e   > < t r > < t d   c o l s p a n = ' 2 ' > < / t d > < / t r > " ;  
                                 h t m l   + =   " < t r > < c e n t e r > < t d > < b r   / > < c e n t e r > < f o n t   c o l o r = ' # 8 B 0 0 0 0 '   f a c e = ' A r i a l '   s i z e = ' 2 ' > " ;  
                                 h t m l   + =   " < s t r o n g > & n b s p ; & n b s p ; & n b s p ; & n b s p ; A f t e r   f i n i s h i n g   w i t h   p a y m e n t   g a t e w a y ,   c l i c k   & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ;   ' R e t u r n   t o   S a n g a p a l a g a i '       b u t t o n   t o   d o w n l o a d   t h e   b o o k . < / s t r o n g >   < / f o n t > < / c e n t e r > < / t d > < / c e n t e r > " ;  
                                 h t m l   + =   " < / t r > < t r > < / t r > < t r > < / t r > < t r > < t d   c o l s p a n = ' 2 ' > < c e n t e r > " ;  
                                   h t m l   + =   " < i n p u t   t y p e = ' b u t t o n '   v a l u e = ' O k '   n a m e = ' C o n f i r m B u t t o n '   o n c l i c k = ' P a y P a l ( t h i s . f o r m ) ; t h i s . d i s a b l e d = t r u e ; '   s t y l e = ' w i d t h :   1 1 9 p x ' / > < / c e n t e r > < / t d > " ;  
                                 h t m l   + =   " < / t r > < / t a b l e > < / f o r m > " ;  
                                   $ ( ' w i n d o w c o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
                                    
                                 d i s p l a y F l o a t i n g D i v ( ' w i n d o w c o n t e n t ' ,   ' p a y p a l   /   c r e d i t   c a r d ' ,   w ,   h ,   l ,   t ) ;  
 	 	         }  
  
  
 f u n c t i o n   P a y P a l ( f r m )  
 { 	  
                 v a r   f o r m n a m e = f r m . n a m e ;    
                 v a r   f o r m a c t i o n = f r m . a c t i o n ;  
                 v a r   f o r m = e v a l ( " d o c u m e n t . " + f o r m n a m e ) ;  
 	         v a r   c r e a t e U R L   =   " D a t a . a s p x ? m o d e = m a i n & r n d = " + M a t h . r a n d o m ( ) ;  
 	         c r e a t e U R L   + =   " & a c t i o n = p a y p a l " ;  
 	         f o r m . m e t h o d = ' P O S T ' ;  
 	         f o r m . a c t i o n = c r e a t e U R L ;  
 	         f o r m . s u b m i t ( ) ;  
 }  
 / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   o n   0 8 / 1 2 / 2 0 0 9  
 / / f u n c t i o n   D o w n l o a d ( f r m , b o o k i d , s t r D a t e , s t r O p t )  
 f u n c t i o n   D o w n l o a d ( f r m , b o o k i d , s t r D a t e , s t r O p t , s t r M a c I D )  
 / / E n d   h e r e  
 {  
   i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' U n A p p r o v e d ' ) )  
   {  
 	 	 v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	 v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
 	         h t m l   + =   ' < t r > ' ;  
 	 	 h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
 	 	 h t m l   + =   ' < / t r > ' ;  
                 h t m l   + =   ' < / t a b l e > ' ;  
                 h t m l   + =   ' < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < c e n t e r > < b > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; P l e a s e   l o g   o n   i f   y o u   a r e   r e g i s t e r e d   u s e r   o r   r e g i s t e r   a n d   l o g   i n .   < / f o n t > < / b > < / c e n t e r > < / s p a n > ' ;  
                 $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
                 $ ( ' t h a n k s ' ) . i n n e r H T M L = " " ;  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	 S e t F o c u s ( ) ;  
 	         r e t u r n ;    
 }  
 e l s e   i f ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' )  
 {  
           v a r   l o g   = d i s p l a y L o g i n ( )   ;  
           v a r   h t m l   =   ' < t a b l e   w i d t h = " 1 0 0 % "   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " " > ' ;  
           h t m l   + =   ' < t r > ' ;  
 	   h t m l   + =   ' < t d   w i d t h = " 0 % " > < i m g   s r c = " g u i / i m g / s p a c e r . g i f "   a l t = " "   w i d t h = " 1 0 "   h e i g h t = " 2 4 " > < / t d > ' ;  
 	   h t m l   + =   ' < / t r > ' ;  
           h t m l   + =   ' < / t a b l e > ' ;  
           h t m l   + =   ' < s p a n   c l a s s = " p r o m o P r o d u c t D e s c " > < c e n t e r > < b > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; & n b s p ; P l e a s e   l o g   i n   w i t h   e m a i l   I D / n e w   u s e r s   r e g i s t e r   a n d   l o g   i n .   < / f o n t > < / b > < / c e n t e r > < / s p a n > ' ;  
           $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   h t m l ;  
           $ ( ' t h a n k s ' ) . i n n e r H T M L = " " ;  
           $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	   $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	   S e t F o c u s ( ) ;  
 	   r e t u r n ;    
 }  
 e l s e  
 {  
           v a r   f o r m n a m e = f r m . n a m e ;    
           v a r   f o r m a c t i o n = f r m . a c t i o n ;  
 	   i f   ( f o r m n a m e = = " f r m S a n g a p a l a g a i R e g i s t e r " )  
           {  
 	           f o r m a c t i o n =   " D o w n l o a d R e g i s t e r " ;  
 	   }  
 	   v a r   f o r m = e v a l ( " d o c u m e n t . " + f o r m n a m e ) ;  
 	   v a r   c r e a t e U R L   =   " D a t a . a s p x ? m o d e = m a i n & r n d = " + M a t h . r a n d o m ( ) ;  
           i f   ( f o r m n a m e = = ' f r m R e a d e r ' )  
           {  
 	           c r e a t e U R L   + =   " & a c t i o n = D o w n l o a d R e a d e r " ;  
 	   }  
 	   e l s e   i f   ( f o r m n a m e = = " f r m S a n g a p a l a g a i R e g i s t e r " )  
 	   {  
 	           c r e a t e U R L   + =   " & a c t i o n = D o w n l o a d R e g i s t e r " ;  
 	   }  
 	   e l s e   i f   ( f o r m n a m e   = =   " f r m G i f t " )  
           {  
                   / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   m a g e s h   o n   0 2 / 0 4 0 / 9                    
                 / / c r e a t e U R L   + =   " & a c t i o n = G i f t & b o o k i d = " + b o o k i d + " & s t r D a t e = " + s t r D a t e ;  
                 c r e a t e U R L   + =   " & a c t i o n = G i f t & b o o k i d = " + b o o k i d + " & s t r D a t e = " + s t r D a t e + " & b i l l N u m b e r = " + s t r O p t ;  
                 / / E n d   h e r e  
                    
           }  
           e l s e   i f   ( f o r m n a m e   = =   " f r m R e v i e w s " )  
           {  
                   c r e a t e U R L   + =   " & a c t i o n = R e v i e w s & b o o k i d = " + b o o k i d ;  
           }  
           e l s e   i f   ( f o r m n a m e . s u b s t r i n g ( 0 , 1 5 ) = =   " f r m D o w n l o a d G i f t " )  
           {          
                   c r e a t e U R L   + =   " & a c t i o n = d o w n l o a d G i f t & b o o k i d = " + b o o k i d + " & s t r D a t e = " + s t r D a t e ;  
           }  
           e l s e   i f   ( ( f o r m n a m e . s u b s t r i n g ( 0 , 1 1 ) = = " f r m d o w n l o a d " )   | |   ( f o r m n a m e = = " f r m S e l e c t " ) )  
           {  
                 / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   o n   0 8 / 1 2 / 2 0 0 9   t o   p a s s   e x t r a   p a r a m e t e r  
                 / /   c r e a t e U R L   + =   " & a c t i o n = d o w n l o a d B o o k & i s o p t i o n = " + s t r O p t + " & b o o k i d = " + b o o k i d + " & s t r D a t e = " + s t r D a t e ;  
                   c r e a t e U R L   + =   " & a c t i o n = d o w n l o a d B o o k & i s o p t i o n = " + s t r O p t + " & b o o k i d = " + b o o k i d + " & s t r D a t e = " + s t r D a t e + " & s t r M a c I D = " + s t r M a c I D ;  
                 / / E n d   h e r e    
           }  
           e l s e   i f   ( ( f o r m n a m e . s u b s t r i n g ( 0 , 1 5 ) = = " f r m f r e e d o w n l o a d " )   )  
           {            
                 i f   ( C u s t [ 0 ] . M a c I D = = t r u e )  
                 {                        
                           / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   g i v e n   b y   m a g a l a k s h m i   o n   1 0 / 0 5 / 2 0 1 0   f o r   p a s s   m a c i d   s t r i n g   t o   f r e e d o w n l o a d   f u n c t i o n  
                         / /   c r e a t e U R L   + =   " & a c t i o n = d o w n l o a d B o o k & i s o p t i o n = i s f r e e & b o o k i d = " + b o o k i d + " & s t r D a t e = " + s t r D a t e ;                        
                         c r e a t e U R L   + =   " & a c t i o n = d o w n l o a d B o o k & i s o p t i o n = i s f r e e & b o o k i d = " + b o o k i d + " & s t r D a t e = " + s t r D a t e + " & s t r M a c I D = " + s t r M a c I D ;                        
                         / / E n d   h e r e   s e n t h i l   1 0 / 0 5 / 2 0 1 0  
                 }  
                 e l s e    
                 {  
                         v a r   h t m l   =   ' < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < b r / > < s p a n   c l a s s = " P a g e T e x t " > < c e n t e r > < f o n t   c o l o r = " # 8 B 0 0 0 0 " > < b > & n b s p ; & n b s p ; & n b s p ;   P l e a s e   d o w n l o a d   t h e   S a n g a p a l a g a i   R e g i s t e r ,   s a v e   a n d   r u n .   < / b r > < / b r > < / b > < / c e n t e r > < / s p a n > ' ;  
                         h t m l   + =   " < f o r m   n a m e = ' f r m S a n g a p a l a g a i R e g i s t e r '   m e t h o d = ' p o s t '   a c t i o n   =   ' D o w n l o a d R e g i s t e r ' > " ;  
                         h t m l   + =   ' < c e n t e r > < i n p u t   t y p e = " b u t t o n "   v a l u e = " R e g i s t e r "   o n c l i c k = "   r e t u r n   D o w n l o a d ( t h i s . f o r m ) "   i d = " B u t t o n 1 " / > ' ;  
 	 	         p a s s w o r d e m a i l e d ( h t m l ) ;  
                 }  
           }  
       	 f o r m . m e t h o d = ' P O S T ' ;  
 	 f o r m . a c t i o n = c r e a t e U R L ;  
 	 f o r m . s u b m i t ( ) ;  
 }  
 }  
 f u n c t i o n   c h e c k k i t ( i d , n a m e )  
 {  
         i s C o l l e c t i o n   =   f a l s e ;  
 	 r e t u r n   i s C o l l e c t i o n ;  
 }  
 / / f u n c t i o n   v a l i d a t e c o n f i r m o r d e r ( f r m c o )  
 / / {  
 / / 	 f o r m s u b m i t ( f r m c o ) ;  
 / / }  
  
 f u n c t i o n   f o r m s u b m i t ( f r m )  
   {      
         v a r   f o r m n a m e = f r m . n a m e ;    
         v a r   f o r m a c t i o n = f r m . a c t i o n ;  
          
         i f   ( f o r m n a m e   = =   " f r m L o g i n " )  
 	 {  
 	           f o r m a c t i o n = " l o g i n " ;  
 	 }  
         i f ( f o r m n a m e = = " f r m r e c o m m e n d " )  
         {  
                 f o r m a c t i o n = " r e c o m m e n d " ;  
         }  
         i f ( f o r m n a m e = = " f r m R e g i s t e r " )  
         {  
                 f o r m a c t i o n = " r e g i s t e r " ;  
         }  
         i f   ( f o r m n a m e   = =   " f r m S r c h " )  
         {  
 	 	 f o r m a c t i o n = " s e a r c h " ;  
 	 }  
 	 i f   ( f o r m n a m e   = =   " f r m C h a n g e P a s s w o r d " )  
       	   {  
 	 	 f o r m a c t i o n = " c h a n g e p a s s w o r d " ;  
 	 }  
 	 i f   ( f o r m n a m e   = =   " f r m F e e d B a c k " )  
         {  
 	 	 f o r m a c t i o n = " F e e d B a c k " ;  
 	 }  
 	 i f   ( f o r m n a m e   = =   " f r m F o r g o t P a s s w o r d " )  
       	   {  
 	 	 f o r m a c t i o n = " f o r g o t p a s s w o r d " ;  
 	   }  
 	   / / a d d e d   b y   d e e p i k a   o n   1 7 / 0 4 / 0 9  
 	   i f   ( f o r m n a m e   = =   " f r m A d d r e s s " )  
 	 {  
 	           f o r m a c t i o n = " A d d r e s s " ;  
 	 }  
  
 	 v a r   f o r m = e v a l ( " d o c u m e n t . " + f o r m n a m e ) ;  
 	 v a r   c r e a t e U R L   =   " D a t a . a s p x ? m o d e = m a i n & r n d = " + M a t h . r a n d o m ( ) ;  
 	 c r e a t e U R L   + =   " & a c t i o n = " + f o r m a c t i o n ;  
 	 f o r m . m e t h o d = ' P O S T ' ;  
 	 f o r m . a c t i o n = c r e a t e U R L ;  
 	 f o r m . s u b m i t ( ) ;  
 	  
         i f ( f o r m n a m e = = " f r m R e g i s t e r " )  
         {          
 	   v a r   l e n = 0 ;  
 	   f o r   ( i = 0 ; i <   ( d o c u m e n t . f r m R e g i s t e r . e l e m e n t s . l e n g t h - 2 ) ; i + + )  
 	   { 	  
 	     l e n = i ;  
 	     d o c u m e n t . f r m R e g i s t e r . e l e m e n t s [ i ] . v a l u e = " "  
 	     i f   ( l e n = = d o c u m e n t . f r m R e g i s t e r . e l e m e n t s . l e n g t h )  
 	     {  
 	       d o c u m e n t . f r m R e g i s t e r . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
             }      
           }  
           r e t u r n   t h i s ;  
         }    
           i f ( f o r m n a m e = = " f r m L o g i n " )  
         {          
 	   v a r   l e n = 0 ;  
 	   f o r   ( i = 0 ; i <   ( d o c u m e n t . f r m L o g i n . e l e m e n t s . l e n g t h - 2 ) ; i + + )  
 	   { 	  
 	     l e n = i ;  
 	     d o c u m e n t . f r m L o g i n . e l e m e n t s [ i ] . v a l u e = " "  
 	     i f   ( l e n = = d o c u m e n t . f r m L o g i n . e l e m e n t s . l e n g t h )  
 	     {  
 	       d o c u m e n t . f r m L o g i n . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
             }      
           }  
           r e t u r n   t h i s ;  
         }    
         i f ( f o r m n a m e = = " f r m C h a n g e P a s s w o r d " )  
           {  
               v a r   l e n = 0 ;  
               f o r   ( i = 0 ; i <   ( d o c u m e n t . f r m C h a n g e P a s s w o r d . e l e m e n t s . l e n g t h - 2 ) ; i + + )  
               { 	  
 	 	 l e n = i ;  
 	 	 d o c u m e n t . f r m C h a n g e P a s s w o r d . e l e m e n t s [ i ] . v a l u e = " "  
 	 	 i f   ( l e n = = d o c u m e n t . f r m C h a n g e P a s s w o r d . e l e m e n t s . l e n g t h )  
 	 	 {  
 	 	   d o c u m e n t . f r m C h a n g e P a s s w o r d . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
                 }    
               }  
               r e t u r n   t h i s ;  
             }      
         i f ( f o r m n a m e = = " f r m U p d a t e a c c o u n t " )  
             {  
                   v a r   l e n = 0 ;  
                   f o r   ( i = 0 ; i <   ( d o c u m e n t . f r m U p d a t e a c c o u n t . e l e m e n t s . l e n g t h - 2 ) ; i + + )  
                   { 	  
                     l e n = i ;  
 	 	     d o c u m e n t . f r m U p d a t e a c c o u n t . e l e m e n t s [ i ] . v a l u e = " "  
 	 	     i f   ( l e n = = d o c u m e n t . f r m U p d a t e a c c o u n t . e l e m e n t s . l e n g t h )  
 	 	     {  
 	 	       d o c u m e n t . f r m U p d a t e a c c o u n t . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
                     }  
               }  
               r e t u r n   t h i s ;  
             }      
         i f ( f o r m n a m e = = " f r m S r c h " )  
         {  
           v a r   l e n = 0 ;  
             f o r   ( i = 0 ; i <   ( d o c u m e n t . f r m S r c h . e l e m e n t s . l e n g t h - 2 ) ; i + + )  
             { 	  
                 l e n = i ;  
 	         d o c u m e n t . f r m S r c h . e l e m e n t s [ i ] . v a l u e = " "  
 	         i f   ( l e n = = d o c u m e n t . f r m S r c h . e l e m e n t s . l e n g t h )  
 	         {  
 	 	           d o c u m e n t . f r m S r c h . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
                 }  
                 e l s e   i f ( d o c u m e n t . f r m S r c h . e l e m e n t s [ i ] . v a l u e = = " " )  
                 {  
                       a l e r t ( " N o   M a t c h e s   F o u n d " ) ;  
                 }  
           }  
           r e t u r n   t h i s ;  
       }                          
 }  
 f u n c t i o n   l o g o u t ( )    
 {  
     v a r   f o r m n a m e   = " f r m l o g o u t "   ;  
     v a r   f o r m a c t i o n = " l o g o u t " ;  
     v a r   f o r m = e v a l ( " d o c u m e n t . " + f o r m n a m e ) ;  
     v a r   c r e a t e U R L   =   " D a t a . a s p x ? m o d e = m a i n & r n d = " + M a t h . r a n d o m ( ) ;  
     c r e a t e U R L   + =   " & a c t i o n = " + f o r m a c t i o n ;  
     f o r m . m e t h o d = ' P O S T ' ;  
     f o r m . a c t i o n = c r e a t e U R L ;  
     f o r m . s u b m i t ( ) ;  
 }  
 f u n c t i o n   f r i e n d f o r m e m a i l c h e c k i n g ( f n d f r m )  
 {  
 	 v a r   f l a g = 1 ;  
 	 v a r   f i l t e r = / ^ ( [ \ w - ] + ( ? : \ . [ \ w - ] + ) * ) @ ( ( ? : [ \ w - ] + \ . ) * \ w [ \ w - ] { 0 , 6 6 } ) \ . ( [ a - z ] { 2 , 6 } ( ? : \ . [ a - z ] { 2 } ) ? ) $ / i  
 	 i f   ( ! f i l t e r . t e s t ( f n d f r m . e l e m e n t s [ 1 ] . v a l u e ) )  
 	 { 	  
 	 	 f l a g = 0 ;  
 	 	 a l e r t ( " P l e a s e   i n p u t   a   v a l i d   e m a i l   a d d r e s s ! " ) ;  
 	 	 f n d f r m . e l e m e n t s [ 1 ] . f o c u s ( ) ;  
 	 	 r e t u r n   t h i s ;  
 	 }  
 	 e l s e  
 	 {  
 	 	 r e t u r n   f o r m s u b m i t ( f n d f r m ) ;  
 	 }  
 }  
 f u n c t i o n   d i s p l a y F e e d B a c k ( )  
 {  
 	 v a r   r e g = d i s p F e e d b a c k ( ) ;  
 	 v a r   e l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " f l a s h C o n t e n t " ) ;  
 	 e l e m e n t . i n n e r H T M L = r e g ;  
           $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
           $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
           	 d o c u m e n t . f r m F e e d B a c k . e l e m e n t s [ 0 ] . f o c u s ( ) ;  
 }  
 f u n c t i o n   d i s p F e e d b a c k ( )  
 {  
 v a r   r e g =   ' < f o r m   n a m e = " f r m F e e d B a c k "   m e t h o d = " p o s t "   a c t i o n = " F e e d B a c k " > < b r > ' ;  
         r e g   + =   ' < t a b l e   b g c o l o r = " # F F F a F 0 "   b o r d e r = " 0 "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 0 "   s t y l e = " H E I G H T :   2 3 p x ;   L E F T :   1 p x ;   T O P :   1 p x ;   W I D T H :   4 3 0 ; " > ' ;  
         r e g   + =   ' < t r > < t d   a l i g n = " c e n t e r "   b g c o l o r = " # F F F a F 0 "   > < p   a l i g n = " c e n t e r " > < f o n t   c o l o r = " # C C 6 6 0 0 "   f a c e = " A r i a l " > < s t r o n g > < f o n t   s i z e = " 5 " > < b > M e m b e r   C o n t r i b u t i o n < / b > < / f o n t >   < / s t r o n g > < / f o n t > < / t d > < / t r > ' ;  
         r e g + = ' < t r > < t d > & n b s p ; < / t d > < / t r > < t d   a l i g n = " l e f t "   c o l s p a n = " 2 "   c l a s s = " s t y l e 8 " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > < b > W h a t   w o u l d   y o u   l i k e   t o   t e l l   u s   a b o u t ? < / b > < / f o n t > < f o n t   c o l o r = " r e d " > * < / f o n t > < / t d > < / t r > ' ;  
         r e g   + = ' < t r > < t d > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " r d R e a d M a g a z i n e "   n a m e = " C o m m e n t "   v a l u e = " R e a d i n g   B o o k s / M a g a z i n e s "   / > R e a d i n g   B o o k s / M a g a z i n e s < / l a b e l > < b r   / > < b r   / > ' ;  
     	 r e g   + = ' < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " r d F i n d M a g a z i n e "   n a m e = " C o m m e n t "   v a l u e = " F i n d i n g   B o o k s / M a g a z i n e s "   / > F i n d i n g   B o o k s / M a g a z i n e s < / l a b e l > < b r   / > < b r   / > < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " r d B o t h "   n a m e = " C o m m e n t "   v a l u e = " B o t h "   / > B o t h < / l a b e l > ' ;  
 	  
 	 r e g + = ' < b r > < t a b l e   b o r d e r = " 0 " > < t r > < t d   a l i g n = " l e f t "   c l a s s = " s t y l e 2 9 " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > < b > H o w   w o u l d   y o u   r a t e   y o u r   e x p e r i e n c e ? < / b > < / f o n t > < f o n t   c o l o r = " r e d " > * < / f o n t > < / t d > < / t r >   < t a b l e   s t y l e = " w i d t h :   4 5 0 p x ;   h e i g h t :   4 8 p x ; " > < t r > ' ;                          
 	 r e g   + = ' < t d   c l a s s = " s t y l e 4 1 " > < / t d > ' ;  
         r e g   + = ' < t d     a l i g n   = " c e n t e r " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > L o v e   i t < / f o n t > < / t d > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 4 1 "   a l i g n   = " c e n t e r " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > R e a l l y   l i k e   i t < / f o n t > < / t d > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 2 3 "   a l i g n   = " c e n t e r " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > L i k e   i t < / f o n t > < / t d > ' ;  
         r e g   + = " < t d   c l a s s = ' s t y l e 2 5 '   a l i g n   = ' c e n t e r ' > < f o n t   f a c e = ' A r i a l '   s i z e = ' 2 ' > D o n ' t   l i k e   i t < / f o n t > < / t d > " ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 3 7 "   a l i g n   = " c e n t e r " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > H a t e   i t < / f o n t > < / t d > ' ;  
         r e g   + = ' < / t r > < t r > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 4 2 " > < / t d > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 4 0 "   a l i g n   = " c e n t e r " > < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " o p t L o v e i t "   n a m e = " o p t R a t e "   v a l u e = " L o v e   i t "   / > < / l a b e l > < / t d > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 4 2 "   a l i g n   = " c e n t e r " > < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " o p t R e a l l y l i k e i t "   n a m e = " o p t R a t e "   v a l u e = " R e a l l y   l i k e   i t "   / > < / l a b e l > < / t d > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 2 2 "   a l i g n   = " c e n t e r " > < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " o p t L i k e i t "   n a m e = " o p t R a t e "   v a l u e = " L i k e   i t "   / > < / l a b e l > < / t d > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 2 4 "   a l i g n   = " c e n t e r " > < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " o p t D o n t "   n a m e = " o p t R a t e "   v a l u e = " D o n t   l i k e   i t "   / > < / l a b e l > < / t d > ' ;  
         r e g   + = ' < t d   c l a s s = " s t y l e 3 8 "   a l i g n   = " c e n t e r " > < l a b e l > < i n p u t   t y p e = " r a d i o "   i d = " o p t H a t e "   n a m e = " o p t R a t e "   v a l u e = " H a t e   i t "   / > < / l a b e l > < / t d > ' ;  
         r e g   + = ' < / t r > < / t a b l e > ' ;  
         r e g   + =   ' < t a b l e   s t y l e = " w i d t h :   4 3 0 "   b o r d e r = " 0 " > < t r > ' ;  
         r e g   + = ' < t d   a l i g n = l e f t   c l a s s = " s t y l e 2 9 " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > < b > T e l l   u s   a b o u t   w h a t   y o u   l i k e : < / b > < / f o n t > < / t d > ' ;  
         r e g   + = " < t d   a l i g n = ' c e n t e r '   c l a s s = ' s t y l e 2 8 ' > < f o n t   f a c e = ' A r i a l '   s i z e = ' 2 ' > < b > W h a t   y o u   D O N ' T   l i k e ? < / b > < / f o n t > < / t d > " ;  
         r e g   + = ' < / t r > < t r > < t d   a l i g n = " l e f t "   c l a s s = " s t y l e 1 8 " > < t e x t a r e a   n a m e = " t x t S u g g e s t i o n "   s t y l e = " H E I G H T :   7 0 p x ;   W I D T H :   2 0 0 p x "   ' ;  
         r e g   + = ' o n k e y d o w n = " i f ( e v e n t . k e y C o d e = = 1 3 )   e v e n t . k e y C o d e = 9 ; " > < / t e x t a r e a > < / t d > ' ;  
 	 r e g   + = ' < t d   a l i g n = " c e n t e r "   c l a s s = " s t y l e 1 3 " > < t e x t a r e a   n a m e = " t x t C r i t i z e "   s t y l e = " H E I G H T :   7 0 p x ;   W I D T H :   2 0 0 p x "   o n k e y d o w n = " i f ( e v e n t . k e y C o d e = = 1 3 )   e v e n t . k e y C o d e = 9 ; " > < / t e x t a r e a > < / t d > < / t r > < / t a b l e > ' ;  
         r e g   + = ' < t a b l e   b o r d e r = " 0 " > < t r > < t d   a l i g n = " l e f t "   c l a s s = " s t y l e 2 9 " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > < b > W h a t   F E A T U R E S   w e   s h o u l d   a d d ? < / b > < / f o n t > < / t d > < / t r > ' ;  
         r e g   + = ' < t r > < t d   a l i g n = " l e f t "   c l a s s = " s t y l e 1 8 " > < t e x t a r e a   n a m e = " t x t F e a t u r e s "   s t y l e = " H E I G H T :   6 0 p x ;   W I D T H :   4 1 5 p x "   o n k e y d o w n = " i f ( e v e n t . k e y C o d e = = 1 3 )   e v e n t . k e y C o d e = 9 ; " > < / t e x t a r e a > < / t d > < t r > ' ;  
         r e g   + = ' < t r > < t d   a l i g n = " l e f t "   c l a s s = " s t y l e 2 8 " > < f o n t   f a c e = " A r i a l "   s i z e = " 2 " > < b > W h a t   B o o k s / M a g a z i n e s   w e   s h o u l d   a d d ? < / b > < / f o n t > < / t d > < / t r > ' ;  
         r e g   + = ' < t r > < t d   a l i g n = " c e n t e r "   c l a s s = " s t y l e 1 3 " >   < t e x t a r e a   n a m e = " t x t A d d i t i o n s "   s t y l e = " H E I G H T :   6 0 p x ;   W I D T H :   4 1 5 p x "   o n k e y d o w n = " i f ( e v e n t . k e y C o d e = = 1 3 )   e v e n t . k e y C o d e = 9 ; " > < / t e x t a r e a > < / t d > < / t r > < / t a b l e > < / t b o d y > ' ;  
         r e g   + = ' < / t a b l e > < t a b l e   b o r d e r = " 0 "   i d = " t a b l e 1 "   s t y l e = " H E I G H T :   7 3 p x ;   W I D T H :   4 0 0 p x " > < t r > < t d   a l i g n = " l e f t "   c l a s s = " s t y l e 3 0 "   > ' ;  
         r e g   + = ' < t a b l e   b o r d e r = " 0 "   w i d t h = " 2 0 0 p x "   a l i g n = " c e n t e r " > < t r > < t d > < i n p u t   t y p e = " b u t t o n "   v a l u e = " S u b m i t "   o n c l i c k = " r e t u r n   V a l i d a t i o n F e e d b a c k ( t h i s . f o r m ) ; " n a m e = " b u t t o n "   s t y l e = " f l o a t :   r i g h t ;   w i d t h :   9 7 p x ;   m a r g i n - l e f t :   2 p x ;   h e i g h t :   2 3 p x ; " / > < / t d > ' ;  
         r e g   + = ' < t d   a l i g n = " c e n t e r " > < i n p u t   t y p e = " r e s e t "   v a l u e = " R e s e t   f o r m "   n a m e = " R e s e t "   s t y l e = " H E I G H T :   2 3 p x ;   W I D T H :   9 7 p x ;   f l o a t : r i g h t ;   m a r g i n - b o t t o m :   0 p x ; " / > ' ;  
         r e g   + = ' < / t d > < / t r > < / t a b l e > ' ;  
               / / c o d e   a d d e d   b y   g e e t h a   f r o m   R a n j i t h   J   o n   0 7 / 0 4 / 2 0 0 9  
        
           r e g + = ' < / t a b l e > < b r / > < d i v   a l i g n = " c e n t e r " > < t a b l e > < t r   a l i g n = " c e n t e r " > < t d   a l i g n = " c e n t e r " > ' ;  
           r e g + = ' < p   a l i g n = " c e n t e r " > < f o n t   c o l o r = " # C C 6 6 0 0 "   f a c e = " A r i a l " > < s t r o n g > < f o n t   s i z e = " 5 " > ' ;  
           r e g + = ' < b > V i e w   C o m m e n t s < / b > < / f o n t >   < / s t r o n g > < / f o n t > < / t d > < / t r > < / t a b l e > < / d i v > ' ;  
           r e g + = ' < d i v   s t y l e = " w i d t h : 4 6 0 p x ;   h e i g h t : 5 0 0 p x ;   o v e r f l o w : a u t o ;   b o r d e r :   t h i n   r i d g e   M a r o o n ;   o v e r f l o w :   a u t o ;   " > ' ;  
           r e g + = ' < t a b l e   s t y l e = " b o r d e r - s p a c i n g :   2 p x ; "   c e l l s p a c i n g = " 1 "   b o r d e r = " 1 " > ' ;                  
           r e g + = ' < t r   s t y l e = " b a c k g r o u n d - c o l o r :   # C 0 C 0 C 0 ;   f o n t - s i z e : s m a l l ;   f o n t - w e i g h t :   b o l d ;   c o l o r :   # 8 0 0 0 0 0   ; " > ' ;  
           r e g + = ' < t d   w i d t h = " 5 0 p x "   a l i g n = " c e n t e r " > N a m e   < / t d > ' ;  
           r e g + = ' < t d   s t y l e = " w i d t h : 5 0 p x ; "   a l i g n = " c e n t e r " > C o u n t r y   < / t d > ' ;  
           / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   o n   0 5 / 0 5 / 2 0 0 9   f o r   c o r r e c t   t h e   s p e l l i n g   m i s t a k e  
           / / r e g + = ' < t d   s t y l e = " w i d t h : 5 0 p x ; "   a l i g n = " c e n t e r "   > A b o u t   S a n g a p a l a g i < / t d > ' ;  
           / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   o n   0 3 / 1 0 / 2 0 0 9   f o r   s h o w   e x t r a   v a l u e   i n   t h e   m e m e b e r   c o m m e n t    
           / / r e g + = ' < t d   s t y l e = " w i d t h : 5 0 p x ; "   a l i g n = " c e n t e r "   > A b o u t   S a n g a p a l a g a i < / t d > ' ;  
           / / r e g + = ' < t d   w i d t h = " 3 1 0 p x " ; a l i g n = " c e n t e r " > C o m m e n t s < / t d > < / t r > ' ;  
           r e g + = ' < t d   s t y l e = " w i d t h : 5 0 p x ; "   a l i g n = " c e n t e r "   > T e l l   U s   A b o u t < / t d > ' ;  
           r e g + = ' < t d   s t y l e = " w i d t h : 5 0 p x ; "   a l i g n = " c e n t e r "   > R a t i n g < / t d > ' ;  
           r e g + = ' < t d   w i d t h = " 5 1 0 p x " ; a l i g n = " c e n t e r " > L i k e < / t d > ' ;  
           r e g + = ' < t d   w i d t h = " 5 1 0 p x " ; a l i g n = " c e n t e r " > D o n \ ' t   L i k e < / t d > ' ;  
           r e g + = ' < t d   w i d t h = " 5 1 0 p x " ; a l i g n = " c e n t e r " > F e a t u r e s < / t d > ' ;  
           r e g + = ' < t d   w i d t h = " 5 1 0 p x " ; a l i g n = " c e n t e r " > A d d i t i o n s < / t d > < / t r > ' ;  
           / / E n d   h e r e   s e n t h i l   o n   0 3 / 1 0 / 2 0 0 9    
         f o r   ( v a r   i = 0 ;   i < F e e d B a c k C o m m e n t s . l e n g t h ;   i + + )  
         {  
           / / r e g + = ' < t r   s t y l e = " f o n t - s i z e :   1 3 p x ;   f o n t - w e i g h t :   b o l d ;   c o l o r :   # 0 0 0 0 0 0 ; " > ' ;  
             r e g + = ' < t r   s t y l e = " f o n t - s i z e :   1 3 p x ;   f o n t - w e i g h t :   b o l d ;   c o l o r :   # 0 0 0 0 0 0 ; " > ' ;  
           r e g + = ' < t d   a l i g n = " c e n t e r " > ' + F e e d B a c k C o m m e n t s [ i ] . N a m e + ' & n b s p ; < / t d > ' ;  
           r e g + = ' < t d   a l i g n = " c e n t e r " > ' + F e e d B a c k C o m m e n t s [ i ] . C o u n t r y + ' & n b s p ; < / t d > ' ;  
           / / C o d e   c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   o n   0 3 / 1 0 / 2 0 0 9   f o r   s h o w   e x t r a   v a l u e   i n   t h e   m e m e b e r   c o m m e n t    
           / / r e g + = ' < t d   a l i g n = " c e n t e r " > ' + F e e d B a c k C o m m e n t s [ i ] . A b o u t S a n g a p a l g a i + ' < / t d > ' ;  
           / / r e g + = ' < t d   a l i g n = " l e f t " > ' + F e e d B a c k C o m m e n t s [ i ] . C o m m e n t s + ' < / t d > ' ;  
           r e g + = ' < t d   a l i g n = " l e f t " > ' + F e e d B a c k C o m m e n t s [ i ] . T e l l U s A b o u t + ' & n b s p ; < / t d > ' ;  
           r e g + = ' < t d   a l i g n = " c e n t e r " > ' + F e e d B a c k C o m m e n t s [ i ] . R a t i n g + ' & n b s p ; < / t d > ' ;  
           r e g + = ' < t d   a l i g n = " l e f t " > ' + F e e d B a c k C o m m e n t s [ i ] . L i k e + ' & n b s p ; < / t d > ' ;  
           r e g + = ' < t d   a l i g n = " l e f t " > ' + F e e d B a c k C o m m e n t s [ i ] . D o n t L i k e + ' & n b s p ; < / t d > ' ;  
           r e g + = ' < t d   a l i g n = " l e f t " > ' + F e e d B a c k C o m m e n t s [ i ] . F e a t u r e s + ' & n b s p ; < / t d > ' ;  
           r e g + = ' < t d   a l i g n = " l e f t " > ' + F e e d B a c k C o m m e n t s [ i ] . A d d i t i o n s + ' & n b s p ; < / t d > ' ;  
           / / E n d   h e r e   s e n t h i l   o n   0 3 / 1 0 / 2 0 0 9  
           r e g + = ' < / t r > ' ;  
         }  
           r e g + = ' < / t a b l e > < / d i v > ' ;    
           / / e n d   h e r e        
         r e g + = ' < / f o r m > ' ;  
  
         r e t u r n   r e g ;  
         }  
 f u n c t i o n   V a l i d a t i o n F e e d b a c k ( f r m )  
   {  
           	 	 f o r   ( i = 0 ; i <   d o c u m e n t . f r m F e e d B a c k . e l e m e n t s . l e n g t h ; i + + )  
 	 	         {  
                         f o r   ( v a r   x   =   0 ; x   <   f r m . o p t R a t e . l e n g t h ;   x + + )  
 	                         {  
 	 	                         v a l i d   =   f r m . o p t R a t e [ x ] . c h e c k e d  
 	 	                         i f   ( v a l i d )   { b r e a k }  
 	                           }  
 	                           i f ( ! v a l i d )  
 	                           {  
 	 	                           a l e r t ( " P l e a s e   s e l e c t   t h e   o p t i o n . " )  
 	 	                           r e t u r n ;  
 	                           }  
 	                           f o r   ( v a r   y   =   0 ; y   <   f r m . C o m m e n t . l e n g t h ;   y + + )  
 	                         {  
 	 	                         v a l i d   =   f r m . C o m m e n t [ y ] . c h e c k e d  
 	 	                         i f   ( v a l i d )   { b r e a k }  
 	                           }  
 	                           i f ( ! v a l i d )  
 	                           {  
 	 	                           a l e r t ( " P l e a s e   s e l e c t   t h e   o p t i o n . " )  
 	 	                           r e t u r n ;  
 	                           }  
            
  
         	       }  
         r e t u r n   f o r m s u b m i t ( f r m ) ;  
   }  
 f u n c t i o n   c h e c k C h e c k B o x e s ( f r m )    
 { 	  
       i f   ( f r m . n a m e = = " v i e w c a r t f o r m " )  
       {  
         i f   ( d o c u m e n t . v i e w c a r t f o r m . c h k A g r e e . c h e c k e d   = =   f a l s e ) 	  
 	 { 	 	  
 	 a l e r t   ( ' P l e a s e   A c c e p t   t h e   t e r m s   a n d   c o n d i t i o n s ! ' ) ; 	  
 	 r e t u r n   f a l s e ; 	  
 	 } 	  
         e l s e 	 	  
         { 	  
 	 r e t u r n   P a y P a l ( f r m ) ; 	 	  
 	 }  
       } 	  
       e l s e   i f   ( f r m . n a m e = = " f r m R e a d e r " )  
       {  
 	 i f   ( d o c u m e n t . f r m R e a d e r . c h k R e a d A g r e e . c h e c k e d   = =   f a l s e ) 	  
 	 { 	 	  
 	 a l e r t   ( ' P l e a s e   A c c e p t   t h e   t e r m s   a n d   c o n d i t i o n s ! ' ) ; 	  
 	 r e t u r n   f a l s e ; 	  
 	 } 	  
         e l s e 	 	  
         { 	  
 	 r e t u r n   D o w n l o a d ( f r m ) ; 	 	  
 	 } 	  
       }  
 }  
 f u n c t i o n   S e t F o c u s ( )    
 {  
 	 v a r   b F o u n d   =   f a l s e ;  
 	 f o r   ( f = 0 ;   f   <   d o c u m e n t . f o r m s . l e n g t h ;   f + + )  
   	 {  
     	 	 f o r ( i = 0 ;   i   <   d o c u m e n t . f o r m s [ f ] . l e n g t h ;   i + + )  
     	 	 {  
       	 	 	 i f   ( d o c u m e n t . f o r m s [ f ] [ i ] . t y p e   ! =   " h i d d e n " )  
         	 	 	 {  
                                         i f   ( d o c u m e n t . f o r m s [ f ] [ i ] . d i s a b l e d   ! =   " d i s a b l e d " )  
             	 	 	 	 {  
                     	 	 	 	 d o c u m e n t . f o r m s [ f ] [ i ] . f o c u s ( ) ;  
                     	 	 	 	 v a r   b F o u n d   =   t r u e ;  
             	 	 	 	 }  
         	 	 	 }  
         	 	 	 i f   ( b F o u n d   = =   t r u e )  
             	 	 	 	 b r e a k ;  
   	 	 }  
     	 	 	 i f   ( b F o u n d   = =   t r u e )  
         	 	 	 	 b r e a k ;  
   	 }  
 }  
  
 / / f u n c t i o n   f u n c a r t o o n j o k e ( )  
 / / {  
  
 / / i f ( ( c a r t o o n . l e n g t h = = 0 ) )  
 / / {  
 / / 	 c a r t o o n = [ { I d : " " , v a l u e : " " , i m a g e : " " } ] ;  
 / / }  
 / / e l s e   i f   ( c a r t o o n [ 0 ] . v a l u e = = ' j o k e ' )  
 / / {  
 / /           v a r   h t m l   =   ' < b r > < t a b l e   w i d t h = " 4 6 0 p x "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 0 " > < t r > ' ;  
 / /                 h t m l + = ' < t d   a l i g n = " c e n t e r "   c l a s s = " h e a d e r t e x t " > J o k e < / t d > < / t r > < t r > < t d > & n b s p ; < / t d > < / t r > ' ;  
 / /                 h t m l   + = ' < t d   w i d t h = " 1 0 0 % "   a l i g n = " c e n t e r " > < i m g   s r c = " ' + c a r t o o n [ 0 ] . i m a g e + ' "   w i d t h = " 4 0 0 "   h e i g h t = " 6 0 0 "   a l t = " " > < / t d > < / t r > ' ;  
 / / 	 	 h t m l   + = ' < / t r > ' ;  
 / / 	 	 h t m l   + = ' < / t a b l e > ' ;  
 / / 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 / / 	 	 	 v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 / / 	 	 	 $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 / /         $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 / / }  
  
 / / }  
 / / f u n c t i o n   f u n t h i r u k k u r a l ( )  
 / / {  
 / / i f ( ( t h i r u k k u r a l . l e n g t h = = 0 ) )  
 / / {  
 / / 	 t h i r u k k u r a l = [ { I d : " " , v a l u e : " " , i m a g e : " " } ] ;  
 / / }  
 / / e l s e   i f   ( t h i r u k k u r a l [ 0 ] . v a l u e = = ' t h i r u k k u r a l ' )  
 / / {  
 / /                 v a r   h t m l   =   ' < b r > < t a b l e   w i d t h = " 4 6 0 p x "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 0 " > < t r > ' ;  
 / /                 h t m l + = ' < t d   a l i g n = " c e n t e r "   c l a s s = " h e a d e r t e x t " > T h i r u k k u r a l < / t d > < / t r > < t r > < t d > & n b s p ; < / t d > < / t r > ' ;  
 / /                 h t m l   + = ' < t d   w i d t h = " 1 0 0 % "   a l i g n = " c e n t e r " > < i m g   s r c = " ' + t h i r u k k u r a l [ 0 ] . i m a g e + ' "   w i d t h = " 4 0 0 "   h e i g h t = " 6 0 0 "   a l t = " " > < / t d > < / t r > ' ;  
 / / 	 	 h t m l   + = ' < / t r > ' ;  
 / / 	 	 h t m l   + = ' < / t a b l e > ' ;  
 / / 	 	 p a s s w o r d e m a i l e d ( h t m l ) ;  
 / / 	 	 	 v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 / / 	 	 	 $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 / /                       $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 / / }  
  
 / / }  
  
 f u n c t i o n   h e l p F a q ( )  
 	 {  
                 c l i e n t S i d e I n c l u d e ( ' f l a s h C o n t e n t ' ,   ' a d m i n / P a g e s / F A Q . h t m l ' ) ;  
 	 	  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g L o g i n F a i l e d ' ) | | (   C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' U n A p p r o v e d ' ) )        
 	           {    
 	           v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	         $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   }  
  
         }  
 	 f u n c t i o n   a b o u t I S ( )  
 	 {  
 	 	 c l i e n t S i d e I n c l u d e ( ' f l a s h C o n t e n t ' ,   ' a d m i n / P a g e s / a b o u t I S . h t m l ' ) ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g L o g i n F a i l e d ' ) | | (   C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' U n A p p r o v e d ' ) )        
 	           {    
 	           v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	         $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   }  
 	 }  
 	 f u n c t i o n   c o n t a c t U s ( )  
 	 {  
 	 	 c l i e n t S i d e I n c l u d e ( ' f l a s h C o n t e n t ' ,   ' a d m i n / P a g e s / C o n t a c t U s . h t m l ' ) ;  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	           i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g L o g i n F a i l e d ' ) | | (   C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' U n A p p r o v e d ' ) )        
 	           {    
 	           v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	         $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   }  
 	 } 	  
 	 f u n c t i o n   t e r m s C o n d i t i o n s ( )  
 	 {  
 	 	 c l i e n t S i d e I n c l u d e ( ' f l a s h C o n t e n t ' ,   ' a d m i n / P a g e s / T e r m s C o n d i t i o n s . h t m l ' ) ;  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g L o g i n F a i l e d ' ) | | (   C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' U n A p p r o v e d ' ) )        
 	           {    
 	           v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	         $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	 	   }  
 	 }  
 	 f u n c t i o n   s i t e m a p ( )  
 	 {  
 	 	 c l i e n t S i d e I n c l u d e ( ' f l a s h C o n t e n t ' ,   ' a d m i n / P a g e s / s i t e m a p . h t m l ' ) ;  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' d e a l h e a d ' ) . i n n e r H T M L = " " ;  
 	 }  
 	 f u n c t i o n   R e a d e r D e m o 2 ( )  
 	 {  
 	 	   v a r   h t m l   = " < c e n t e r > < t a b l e > < i m g   a l t   = ' '   h e i g h t = ' 2 0 '   w i d t h = ' 4 6 5 '     s r c = ' i m a g e s / s p a c e r . g i f '   a l i g n = ' m i d d l e ' / > < t r > < t d   a l i g n = ' c e n t e r ' > " ;  
 	 	         h t m l   + =   " < c e n t e r > < e m b e d   s r c = ' i m a g e s / R e a d e r D e m o . s w f ' w i d t h = ' 2 5 0 '   h e i g h t = ' 2 5 0 '   t y p e = ' a p p l i c a t i o n / x - s h o c k w a v e - f l a s h '   > " ;  
 	 	         h t m l   + =   " < / t d > < / t r > < t r > < t d   a l i g n = ' c e n t e r ' > " ;  
 	 	         h t m l   + =   " < a   h r e f = ' j a v a s c r i p t : C l o s e ( ) ' > < f o n t   c o l o r = ' # 8 B 0 0 0 0 '   s i z e   = 2 > < s t r o n g > B a c k   T o   H o m e < / s t r o n g > < / f o n t > < / a > < / t a b l e > < / c e n t e r > " ;  
                  
                 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   h t m l ;  
 	 }  
 	 f u n c t i o n   C l o s e ( )  
 	 {  
                 d o c u m e n t . l o c a t i o n . h r e f = " d e f a u l t . a s p x " ;  
 	 }  
 	  
 	 f u n c t i o n   A b o u t R e a d e r ( )  
 	 {  
 	 c l i e n t S i d e I n c l u d e ( ' f l a s h C o n t e n t ' ,   ' a d m i n / P a g e s / A b o u t R e a d e r . h t m l ' ) ;  
 	 	 $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
 	 	 $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;  
 	         i f ( ( C u s t . l e n g t h = = 0 )   | | ( C u s t [ 0 ] . F i r s t N a m e = = ' ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' L o g i n F a i l e d ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' R e g L o g i n F a i l e d ' ) | | (   C u s t [ 0 ] . F i r s t N a m e = = ' R e g S u c c e s s ' ) | | ( C u s t [ 0 ] . F i r s t N a m e = = ' U n A p p r o v e d ' ) )  
                 {    
 	                   v a r   l o g   = d i s p l a y L o g i n ( )   ;  
 	 	                 $ ( ' c a r t ' ) . i n n e r H T M L   =   l o g ;  
 	         }  
 	         e l s e  
 	         {  
 	 	                   v a r   c a r t = C a r t ;  
 	 	 	         s h o w C a r t ( c a r t , ' f a l s e ' ) ;  
 	         }  
 	  
 	 }  
  
 f u n c t i o n   p r e s s R e v i e w ( )  
 {  
         v a r   r e g = " < t a b l e     c e l l p a d d i n g = ' 0 '   c e l l s p a c i n g = ' 0 '   b o r d e r = ' 0 '   w i d t h = ' 1 0 0 % '   > " ;  
 	 r e g + = ' < t r > < t d   a l i g n = " c e n t e r "   b g c o l o r = " # F F F a F 0 "   > ' ;  
         r e g + = ' < f o n t   c o l o r = # C C 6 6 0 0   f a c e = " A r i a l " > < s t r o n g > < f o n t   s i z e = " 5 " > < b > P r e s s   R e v i e w s < / b >   ' ;        
         r e g + = ' < / f o n t >   < / s t r o n g > < / f o n t > < / t d > < / t r > < b r / > < / t a b l e > ' ;  
         r e g   + = '   < t r > < / t r > ' ;  
         r e g + = " < t r > < t d   w i d t h = 1 0 0 % > " ;  
 	 i f ( P r e s s R e v i e w . l e n g t h ! = 0 )  
 	 {  
                 f o r   ( v a r   i = 0 ; i < P r e s s R e v i e w . l e n g t h ; i + + )  
                 {        
                         r e g + = ' < l i > < a   h r e f = " ' + P r e s s R e v i e w [ i ] . i m a g e + ' "   t a r g e t = " _ b l a n k " > < f o n t   c o l o r = " B l u e " > < s t r o n g > ' + P r e s s R e v i e w [ i ] . t i t l e + ' < / s t r o n g > ' ;  
                         r e g + = '   < / f o n t > < / a > < / l i > < b r   / > ' ;  
                 }  
         }  
         r e g + = " < / t d > < / t r > " ;  
         r e g   + = " < / t a b l e > " ; 	  
         $ ( ' f l a s h C o n t e n t ' ) . i n n e r H T M L   =   r e g ;  
         $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;  
         $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;    
         w i n d o w . s c r o l l T o ( 0 , 0 ) ;  
         w i n d o w . f o c u s ( ) ;          
        
 }  
  
  
 / / c o d e   a d d e d   b y   s e n t h i l   g i v e n   b y   b h a r a t h i   o n   1 5 / 0 9 / 0 9  
 f u n c t i o n   d i s p l a y P r o d u c t S P R e a d e r ( p a g e n o , f u n N a m e )  
 {  
         c l i e n t S i d e I n c l u d e ( ' f l a s h C o n t e n t ' ,   ' a d m i n / P a g e s / D o w n L o a d S P R e a e r . h t m ' ) ;  
               / / v a r   u r l   =   ' D a t a . a s p x ? m o d e = m a i n & r n d = ' + M a t h . r a n d o m ( ) + ' & a c t i o n = p r o d u c t l i s t & p a g e n o = ' + p a g e n o ;  
 	   / / h a n d l e R e q u e s t ( G E T ,   u r l ,   f u n D i s p l a y P r o d u c t s , p r o g r e s s , p a g e n o , f u n N a m e ) ;  
       	   / / C o d e   u n c o m m e n t e d   a n d   a d d e d   b y   s e n t h i l   o n   0 3 / 1 0 / 2 0 0 9    
       	   $ ( ' l i s t P r o d u c t s ' ) . i n n e r H T M L   =   " " ;    
       	   $ ( ' l i s t I t e m s ' ) . i n n e r H T M L   =   " " ;    
       	   / / E n d   h e r e    
 }  
 / / e n d   h e r e   b h a r a t h i   o n   1 5 / 0 9 / 0 9  
 
