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