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