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