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