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