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