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