ÿþv a r   n o   =   1 0 ;  
 v a r   s p e e d   =   8 ;  
  
 b a l l o o n   =   n e w   A r r a y ( ) ;  
 b a l l o o n [ 0 ]   =   " h t t p : / / w w w . t a g k o r e a . p e . k r / j s / n 1 . g i f " ;  
 b a l l o o n [ 1 ]   =   " h t t p : / / w w w . t a g k o r e a . p e . k r / j s / n 2 . g i f " ;  
 b a l l o o n [ 2 ]   =   " h t t p : / / w w w . t a g k o r e a . p e . k r / j s / n 3 . g i f " ;  
 v a r   m a x b a l l o o n   =   2 ;  
  
 v a r   n s 4 u p   =   ( d o c u m e n t . l a y e r s )   ?   1   :   0 ;  
 v a r   i e 4 u p   =   ( d o c u m e n t . a l l )   ?   1   :   0 ;  
 v a r   d x ,   x p ,   y p ;  
 v a r   a m ,   s t x ,   s t y ;  
 v a r   i ,   d o c _ w i d t h   =   1 0 2 4 ,   d o c _ h e i g h t   =   1 0 2 4 ;  
  
 i f   ( n s 4 u p )   {  
   d o c _ w i d t h   =   s e l f . i n n e r W i d t h ;  
   d o c _ h e i g h t   =   s e l f . i n n e r H e i g h t   -   5 0 ;  
 }   e l s e   i f   ( i e 4 u p )   {  
   d o c _ w i d t h   =   d o c u m e n t . b o d y . c l i e n t W i d t h ;  
   d o c _ h e i g h t   =   d o c u m e n t . b o d y . c l i e n t H e i g h t   - 5 0 ;  
 }  
  
 d x   =   n e w   A r r a y ( ) ;  
 x p   =   n e w   A r r a y ( ) ;  
 y p   =   n e w   A r r a y ( ) ;  
 a m   =   n e w   A r r a y ( ) ;  
 s t x   =   n e w   A r r a y ( ) ;  
 s t y   =   n e w   A r r a y ( ) ;  
 j   =   m a x b a l l o o n ;  
 f o r   ( i   =   0 ;   i   <   n o ;   + +   i )   {  
   d x [ i ]   =   0 ;  
   x p [ i ]   =   M a t h . r a n d o m ( ) * ( d o c _ w i d t h - 5 0 ) ;  
   y p [ i ]   =   M a t h . r a n d o m ( ) * d o c _ h e i g h t ;  
   a m [ i ]   =   M a t h . r a n d o m ( ) * 2 0 ;  
   s t x [ i ]   =   0 . 0 2   +   M a t h . r a n d o m ( ) / 1 0 ;  
   s t y [ i ]   =   0 . 7   +   M a t h . r a n d o m ( ) ;  
   i f   ( n s 4 u p )   {  
     i f   ( i   = =   0 )   {  
       d o c u m e n t . w r i t e ( " < l a y e r   n a m e = \ " d o t " +   i   + " \ "   l e f t = \ " 1 5 \ "   t o p = \ " 5 0 0 \ "   v i s i b i l i t y = \ " s h o w \ " > < i m g   s r c = \ " "   +   b a l l o o n [ j ]   +   " \ "   b o r d e r = \ " 0 \ " > < / l a y e r > " ) ;  
     }   e l s e   {  
       d o c u m e n t . w r i t e ( " < l a y e r   n a m e = \ " d o t " +   i   + " \ "   l e f t = \ " 1 5 \ "   t o p = \ " 5 0 0 \ "   v i s i b i l i t y = \ " s h o w \ " > < i m g   s r c = \ " "   +   b a l l o o n [ j ]   +   " \ "   b o r d e r = \ " 0 \ " > < / l a y e r > " ) ;  
         }  
   }   e l s e   i f   ( i e 4 u p )   {  
     i f   ( i   = =   0 )   {  
       d o c u m e n t . w r i t e ( " < d i v   i d = \ " d o t " +   i   + " \ "   s t y l e = \ " P O S I T I O N :   a b s o l u t e ;   Z - I N D E X :   " +   i   + " ;   V I S I B I L I T Y :   v i s i b l e ;   T O P :   5 0 0 p x ;   L E F T :   1 5 p x ; \ " > < i m g   s r c = \ " "   +   b a l l o o n [ j ]   +   " \ "   b o r d e r = \ " 0 \ " > < / d i v > " ) ;  
     }   e l s e   {  
       d o c u m e n t . w r i t e ( " < d i v   i d = \ " d o t " +   i   + " \ "   s t y l e = \ " P O S I T I O N :   a b s o l u t e ;   Z - I N D E X :   " +   i   + " ;   V I S I B I L I T Y :   v i s i b l e ;   T O P :   5 0 0 p x ;   L E F T :   1 5 p x ; \ " > < i m g   s r c = \ " "   +   b a l l o o n [ j ]   +   " \ "   b o r d e r = \ " 0 \ " > < / d i v > " ) ;  
           }  
   }  
   i f   ( j   = =   0 )   {   j   =   m a x b a l l o o n ;   }   e l s e   {   j   - =   1 ;   }  
 }  
  
 f u n c t i o n   s n o w N S ( )   {  
   f o r   ( i   =   0 ;   i   <   n o ;   + +   i )   {  
     y p [ i ]   + =   s t y [ i ] ;  
     i f   ( y p [ i ]   >   d o c _ h e i g h t )   {  
       x p [ i ]   =   M a t h . r a n d o m ( ) * ( d o c _ w i d t h - a m [ i ] - 3 0 ) ;  
       y p [ i ]   =   0 ;  
       s t x [ i ]   =   0 . 0 2   +   M a t h . r a n d o m ( ) / 1 0 ;  
       s t y [ i ]   =   0 . 7   +   M a t h . r a n d o m ( ) ;  
       d o c _ w i d t h   =   s e l f . i n n e r W i d t h ;  
       d o c _ h e i g h t   =   s e l f . i n n e r H e i g h t ;  
     }  
     d x [ i ]   + =   s t x [ i ] ;  
     d o c u m e n t . l a y e r s [ " d o t " + i ] . t o p   =   y p [ i ] ;  
     d o c u m e n t . l a y e r s [ " d o t " + i ] . l e f t   =   x p [ i ]   +   a m [ i ] * M a t h . s i n ( d x [ i ] ) ;  
   }  
   s e t T i m e o u t ( " s n o w N S ( ) " ,   s p e e d ) ;  
 }  
  
 f u n c t i o n   s n o w I E ( )   {  
   f o r   ( i   =   0 ;   i   <   n o ;   + +   i )   {  
     y p [ i ]   + =   s t y [ i ] ;  
     i f   ( y p [ i ]   >   d o c _ h e i g h t - 1 0 )   {  
       x p [ i ]   =   M a t h . r a n d o m ( ) * ( d o c _ w i d t h - a m [ i ] - 3 0 ) ;  
       y p [ i ]   =   0 ;  
       s t x [ i ]   =   0 . 0 2   +   M a t h . r a n d o m ( ) / 1 0 ;  
       s t y [ i ]   =   0 . 7   +   M a t h . r a n d o m ( ) ;  
       d o c _ w i d t h   =   d o c u m e n t . b o d y . c l i e n t W i d t h ;  
       d o c _ h e i g h t   =   d o c u m e n t . b o d y . c l i e n t H e i g h t ;  
     }  
   d x [ i ]   + =   s t x [ i ] ;  
   d o c u m e n t . a l l [ " d o t " + i ] . s t y l e . p i x e l T o p   =   y p [ i ] ;  
   d o c u m e n t . a l l [ " d o t " + i ] . s t y l e . p i x e l L e f t   =   x p [ i ]   +   a m [ i ] * M a t h . s i n ( d x [ i ] ) ;  
   }  
   s e t T i m e o u t ( " s n o w I E ( ) " ,   s p e e d ) ;  
 }  
  
 i f   ( n s 4 u p )   {  
   s n o w N S ( ) ;  
 }   e l s e   i f   ( i e 4 u p )   {  
   s n o w I E ( ) ;  
 }  
  
 
