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