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