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