ÿþ/ * *  
   *   j Q u e r y   W i n d o w   P l u g i n   -   T o   P o p u p   A   B e a u t i f u l   W i n d o w - l i k e   D i a l o g  
   *   h t t p : / / f s t o k e . m e / j q u e r y / w i n d o w /  
   *   C o p y r i g h t ( c )   2 0 1 1   D a v i d   H u n g  
   *   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  
   *   V e r s i o n :   5 . 0 3  
   *   L a s t   R e v i s i o n :   2 0 1 1 - 0 4 - 3 0  
   *  
   *   T h e   w i n d o w   s t a t u s   i s   d e f i n e d   a s :   c a s c a d e ( d e f a u l t ) ,   m i n i m i z e d ,   m a x m i z e d  
   *    
   *   T h e   c o d e   s t y l e   i s   r e f e r e n c e   f r o m   j a v a s c r i p t   S i n g l e t o n   d e s i g n   p a t t e r n .   P l e a s e   s e e :  
   *   h t t p : / / f s t o k e . m e / b l o g / ? p a g e _ i d = 1 6 1 0  
   *    
   *   J o i n   t h e   f a c e b o o k   f a n s   p a g e   t o   d i s c u s s   t h e r e   a n d   g e t   l a t e s t   i n f o r m a t i o n .  
   *   h t t p : / / w w w . f a c e b o o k . c o m / p a g e s / j Q u e r y - W i n d o w - P l u g i n / 1 1 6 7 6 9 9 6 1 6 6 7 1 3 8  
   *  
   *   T h i s   j Q u e r y   p l u g i n   h a s   b e e n   t e s t e d   i n   t h e   f o l l o w i n g   b r o w s e r s :  
   *   -   I E   7 ,   8  
   *   -   F i r e f o x   3 . 5 +  
   *   -   O p e r a   9 ,   1 0 +  
   *   -   S a f a r i   4 . 0 +  
   *   -   C h r o m e   2 . 0 +  
   *  
   *   R e q u i r e d   j Q u e r y   L i b r a r i e s :  
   *   j q u e r y . j s                   ( v 1 . 3 . 2 )  
   *   j q u e r y - u i . j s             ( v 1 . 7 . 2 )  
   *  
   *   C u s t o m i z e d   B u t t o n   J S O N   A r r a y   S a m p l e :  
 	 v a r   m y B u t t o n s   =   [  
 	 	 / /   f a c e b o o k   b u t t o n  
 	 	 {  
 	 	 i d :   " b t n _ f a c e b o o k " ,                       / /   r e q u i r e d ,   i t   m u s t   b e   u n i q u e   i n   t h i s   a r r a y   d a t a  
 	 	 t i t l e :   " s h a r e   t o   f a c e b o o k " ,       / /   o p t i o n a l ,   i t   w i l l   p o p u p   a   t o o l t i p   b y   b r o w s e r   w h i l e   m o u s e   c u r s o r   o v e r   i t  
 	 	 c l a z z :   " m y _ b u t t o n " ,                       / /   o p t i o n a l ,   d o n ' t   s e t   b o r d e r ,   p a d d i n g ,   m a r g i n   o r   a n y   s t y l e   w h i c h   w i l l   c h a n g e   e l e m e n t   p o s i t i o n   o r   s i z e  
 	 	 s t y l e :   " " ,                                         / /   o p t i o n a l ,   d o n ' t   s e t   b o r d e r ,   p a d d i n g ,   m a r g i n   o r   a n y   s t y l e   w h i c h   w i l l   c h a n g e   e l e m e n t   p o s i t i o n   o r   s i z e  
 	 	 i m a g e :   " i m g / f a c e b o o k . g i f " ,         / /   o p t i o n a l ,   t h e   i m a g e   u r l   o f   b u t t o n   i c o n ( 1 6 x 1 6   p i x e l s )  
 	 	 c a l l b a c k :                                           / /   r e q u i r e d ,   t h e   c a l l b a c k   f u n c t i o n   w h i l e   c l i c k   i t  
 	 	 	 f u n c t i o n ( b t n ,   w n d )   {  
 	 	 	 	 w n d . g e t C o n t a i n e r ( ) . f i n d ( " # d e m o _ t e x t " ) . t e x t ( " S h a r e   t o   f a c e b o o k ! " ) ;  
 	 	 	 	 w n d . g e t C o n t a i n e r ( ) . f i n d ( " # d e m o _ l o g o " ) . a t t r ( " s r c " ,   " i m g / f a c e b o o k _ 3 0 0 x 1 0 0 . p n g " ) ;  
 	 	 	 }  
 	 	 } ,  
 	 	 / /   t w i t t e r   b u t t o n  
 	 	 {  
 	 	 i d :   " b t n _ t w i t t e r " ,  
 	 	 t i t l e :   " s h a r e   t o   t w i t t e r " ,  
 	 	 c l a z z :   " m y _ b u t t o n " ,  
 	 	 s t y l e :   " b a c k g r o u n d : # e e e ; " ,  
 	 	 i m a g e :   " i m g / t w i t t e r . p n g " ,  
 	 	 c a l l b a c k :  
 	 	 	 f u n c t i o n ( b t n ,   w n d )   {  
 	 	 	 	 w n d . g e t C o n t a i n e r ( ) . f i n d ( " # d e m o _ t e x t " ) . t e x t ( " S h a r e   t o   t w i t t e r ! " ) ;  
 	 	 	 	 w n d . g e t C o n t a i n e r ( ) . f i n d ( " # d e m o _ l o g o " ) . a t t r ( " s r c " ,   " i m g / t w i t t e r _ 3 0 0 x 1 0 0 . j p g " ) ;  
 	 	 	 }  
 	 	 }  
 	 ] ;  
   * /  
 	  
 / /   G e t   w i n d o w   i n s t a n c e   v i a   j Q u e r y   c a l l  
 / /   c r e a t e   w i n d o w   o n   h t m l   b o d y  
 $ . w i n d o w   =   f u n c t i o n ( o p t i o n s )   {  
 	 r e t u r n   $ . W i n d o w . g e t I n s t a n c e ( n u l l ,   o p t i o n s ) ;  
 } ;  
  
 / /   c r e a t e   w i n d o w   o n   c a l l e r   e l e m e n t  
 $ . f n . w i n d o w   =   f u n c t i o n ( o p t i o n s )   {  
 	 r e t u r n   $ . W i n d o w . g e t I n s t a n c e ( $ ( t h i s ) ,   o p t i o n s ) ;  
 }  
  
 / /   C r e a t i n g   W i n d o w   D i a l o g   M o d u l e  
 $ . W i n d o w   =   ( f u n c t i o n ( )     {  
 	 / /   s t a t i c   p r i v a t e   m e t h o d s  
 	 / /   s t a t i c   c o n s t a n t s  
 	 v a r   V E R S I O N   =   " 5 . 0 3 " ;                       / /   t h e   v e r s i o n   o f   c u r r e n t   p l u g i n  
 	 v a r   I C O N _ W H   =   1 6 ;                               / /   w i n d o w   i c o n   b u t t o n   w i d t h / h e i g h t ,   i n   p i x e l s .   c h e c k   " w i n d o w _ i c o n _ b u t t o n "   s t y l e   i n   c s s  
 	 v a r   I C O N _ M A R G I N   =   4 ;                         / /   w i n d o w   i c o n   b u t t o n   m a r g i n ,   i n   p i x e l s .   c h e c k   " w i n d o w _ i c o n _ b u t t o n "   s t y l e   i n   c s s  
 	 v a r   I C O N _ O F F S E T   =   I C O N _ W H   +   I C O N _ M A R G I N ;   / /   w i n d o w   i c o n   b u t t o n   o f f s e t   f o r   d e c i d e   f u n c t i o n   b a r   w i d t h   i n   h e a d e r   p a n e l  
 	 v a r   O P A C I T Y _ M I N I M I Z E D   =   0 . 7 ;         / /   c s s   o p a c i t y   w h i l e   w i n d o w   m i n i m i z e d   o r   d o i n g   a n i m a t i o n  
 	 v a r   M I N I M I Z E D _ N A R R O W   =   2 4 ;  
 	 v a r   M I N I M I Z E D _ L O N G   =   1 2 0 ;  
 	 v a r   R E S I Z E _ E V E N T _ D E L A Y   =   2 0 0 ;  
 	 v a r   u a   =   n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) ;   / /   b r o w s e r   u s e r a g e n t  
 	  
 	 / /   s t a t i c   v a r i a b l e s  
 	 v a r   w i n d o w I n d e x   =   0 ;                         / /   i n d e x   t o   c r e a t e   w i n d o w   i n s t a n c e   i d  
 	 v a r   l a s t S e l e c t e d W i n d o w   =   n u l l ;     / /   t o   r e m e m b e r   l a s t   s e l e c t e d   w i n d o w   i n s t a n c e  
 	 v a r   w i n d o w S t o r a g e   =   [ ] ;                   / /   a   a r r a y   t o   s t o r e   c r e a t e d   w i n d o w   i n s t a n c e  
 	 v a r   i n i t i a l i z e d   =   f a l s e ;                 / /   a   b o o l e a n   f l a g   t o   c h e c k   i s   i t   i n i t i a l i z e d ?  
 	 v a r   r e s i z e T i m e r   =   n u l l ;                   / /   a   t i m e r   t o   a v o i d   d o i n g   d u p l i c a t e d   r o u t i n e   w h i l e   r e c e i v i n g   b r o w s e r   w i n d o w   r e s i z e   e v e n t  
 	 v a r   p a r e n t C a l l e r s   =   [ ] ;                   / /   a   s t o r a g e   t o   s a v e   c a l l e r   o b j e c t  
 	 v a r   m i n W i n D a t a   =   {                             / /   g l o b a l   m i n i m i z e d   w i n d o w   d a t a  
 	 	 l o n g :   M I N I M I Z E D _ L O N G ,  
 	 	 s t o r a g e :   [ ]                                   / /   a   s t o r a g e   t o   s a v e   m i n i m i z e d   w i n d o w   i n s t a n c e  
 	 } ;  
 	  
 	 / /   t h e   s t a t i c   s e t t i n g  
 	 v a r   s e t t i n g   =   {  
 	 	 d o c k :   ' l e f t ' ,                                       / /   [ s t r i n g : " l e f t " ]   t h e   d i r e c t i o n   o f   m i n i m i z e d   w i n d o w   d o c k   a t .   t h e   a v a i l a b l e   v a l u e s   a r e   [ l e f t ,   r i g h t ,   t o p ,   b o t t o m ]  
 	 	 d o c k A r e a :   n u l l ,                                   / /   [ j q u e r y   o b j e c t ,   e l e m e n t : n u l l ]   t h e   a r e a   w h i c h   t h e   w i n d o w s   w i l l   d o c k   a t  
 	 	 a n i m a t i o n S p e e d :   4 0 0 ,                         / /   [ n u m b e r : 4 0 0 ]   t h e   s p e e d   o f   a n i m a t i o n s :   m a x i m i z e ,   m i n i m i z e ,   r e s t o r e ,   s h i f t ,   i n   m i l l i s e c o n d s  
 	 	 m i n W i n N a r r o w :   M I N I M I Z E D _ N A R R O W ,   / /   [ n u m b e r : 2 4 ]   t h e   n a r r o w   d i m e n s i o n   o f   m i n i m i z e d   w i n d o w  
 	 	 m i n W i n L o n g :   M I N I M I Z E D _ L O N G ,           / /   [ n u m b e r : 1 2 0 ]   t h e   l o n g   d i m e n s i o n   o f   m i n i m i z e d   w i n d o w  
 	 	 h a n d l e S c r o l l b a r :   t r u e ,                     / /   [ b o o l e a n : t r u e ]   t o   h a n d l e   b r o w s e r   s c r o l l b a r   w h e n   w i n d o w   s t a t u s   c h a n g e d ( m a x i m i z e ,   m i n i m i z e ,   c a s c a d e )  
 	 	 s h o w L o g :   f a l s e                                     / /   [ b o o l e a n : f a l s e ]   t o   d e c i d e   s h o w   l o g   i n   f i r e b u g ,   I E 8 ,   c h r o m e   c o n s o l e  
 	 } ;  
 	  
 	 / /   s e l e c t   t h e   c u r r e n t   c l i c k e d   w i n d o w   i n s t a n c e ,   c o n c u r r e n t l y ,   u n s e l e c t   l a s t   s e l e c t e d   w i n d o w   i n s t a n c e  
 	 f u n c t i o n   s e l e c t W i n d o w ( p a r e n t ,   w n d )   {  
 	 	 i f (   p a r e n t   = =   n u l l   )   {  
 	 	 	 i f (   l a s t S e l e c t e d W i n d o w   ! =   n u l l   & &   l a s t S e l e c t e d W i n d o w   ! =   w n d   )   {  
 	 	 	 	 l a s t S e l e c t e d W i n d o w . u n s e l e c t ( ) ;  
 	 	 	 	 w n d . s e l e c t ( ) ;  
 	 	 	 }   e l s e   i f (   l a s t S e l e c t e d W i n d o w   = =   n u l l   )   {  
 	 	 	 	 w n d . s e l e c t ( ) ;  
 	 	 	 }  
 	 	 	 l a s t S e l e c t e d W i n d o w   =   w n d ;  
 	 	 }   e l s e   {  
 	 	 	 i f (   p a r e n t . g e t ( 0 ) . _ l a s t S e l e c t e d W i n d o w   ! =   n u l l   & &   p a r e n t . g e t ( 0 ) . _ l a s t S e l e c t e d W i n d o w   ! =   w n d   )   {  
 	 	 	 	 p a r e n t . g e t ( 0 ) . _ l a s t S e l e c t e d W i n d o w . u n s e l e c t ( ) ;  
 	 	 	 	 w n d . s e l e c t ( ) ;  
 	 	 	 }   e l s e   i f (   p a r e n t . g e t ( 0 ) . _ l a s t S e l e c t e d W i n d o w   = =   n u l l   )   {  
 	 	 	 	 w n d . s e l e c t ( ) ;  
 	 	 	 }  
 	 	 	 p a r e n t . g e t ( 0 ) . _ l a s t S e l e c t e d W i n d o w   =   w n d ;  
 	 	 }  
 	 }  
 	  
 	 / /   g e t   t h e   w i n d o w   i n s t a n c e  
 	 f u n c t i o n   g e t W i n d o w ( w i n d o w I d )   {  
 	 	 f o r (   v a r   i = 0 ,   l e n = w i n d o w S t o r a g e . l e n g t h ;   i < l e n ;   i + +   )   {  
 	 	 	 v a r   w n d   =   w i n d o w S t o r a g e [ i ] ;  
 	 	 	 i f (   w n d . g e t W i n d o w I d ( )   = =   w i n d o w I d   )   {  
 	 	 	 	 r e t u r n   w n d ;  
 	 	 	 }  
 	 	 }  
 	 }  
 	  
 	 / /   p u s h   t h e   w i n d o w   i n s t a n c e   i n t o   s t o r a g e  
 	 f u n c t i o n   p u s h W i n d o w ( w n d )   {  
 	 	 w i n d o w S t o r a g e . p u s h ( w n d ) ;  
 	 }  
 	  
 	 / /   p o p   t h e   w i n d o w   i n s t a n c e   f r o m   s t o r a g e   o u t  
 	 f u n c t i o n   p o p W i n d o w ( w n d )   {  
 	 	 f o r (   v a r   i = 0 ,   l e n = w i n d o w S t o r a g e . l e n g t h ;   i < l e n ;   i + +   )   {  
 	 	 	 v a r   w   =   w i n d o w S t o r a g e [ i ] ;  
 	 	 	 i f (   w   = =   w n d   )   {  
 	 	 	 	 w i n d o w S t o r a g e . s p l i c e ( i - - , 1 ) ;   / /   r e m o v e   a r r a y   e l e m e n t  
 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	 }  
 	 }  
 	  
 	 / /   p u s h   t h e   w i n d o w   i n s t a n c e   i n t o   m i n i m i z e d   s t o r a g e  
 	 f u n c t i o n   p u s h M i n W i n d o w ( p a r e n t ,   w n d )   {  
 	 	 i f (   s e t t i n g . d o c k A r e a   ! =   n u l l   )   {  
 	 	 	 p a r e n t   =   $ ( s e t t i n g . d o c k A r e a ) ;  
 	 	 }  
 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 p a r e n t . g e t ( 0 ) . _ m i n W i n D a t a . s t o r a g e . p u s h ( w n d ) ;  
 	 	 }   e l s e   {  
 	 	 	 m i n W i n D a t a . s t o r a g e . p u s h ( w n d ) ;  
 	 	 }  
 	 }  
 	  
 	 / /   p o p   t h e   w i n d o w   i n s t a n c e   f r o m   m i n i m i z e d   s t o r a g e   o u t  
 	 f u n c t i o n   p o p M i n W i n d o w ( p a r e n t ,   w n d )   {  
 	 	 v a r   d o A d j u s t   =   f a l s e ;  
 	 	 p a r e n t   =   ( s e t t i n g . d o c k A r e a   ! =   n u l l ) ?   $ ( s e t t i n g . d o c k A r e a ) : p a r e n t ;  
 	 	 v a r   s t o r a g e   =   ( p a r e n t   ! =   n u l l ) ?   p a r e n t . g e t ( 0 ) . _ m i n W i n D a t a . s t o r a g e : m i n W i n D a t a . s t o r a g e ;  
 	 	 f o r (   v a r   i = 0 ;   i < s t o r a g e . l e n g t h ;   i + +   )   {  
 	 	 	 v a r   w   =   s t o r a g e [ i ] ;  
 	 	 	 i f (   w   = =   w n d   )   {  
 	 	 	 	 s t o r a g e . s p l i c e ( i - - , 1 ) ;   / /   r e m o v e   a r r a y   e l e m e n t  
 	 	 	 	 d o A d j u s t   =   t r u e ;  
 	 	 	 	 c o n t i n u e ;  
 	 	 	 }  
 	 	 	 i f (   d o A d j u s t   )   {  
 	 	 	 	 w . _ d e c r e a s e M i n i I n d e x ( ) ;  
 	 	 	 }  
 	 	 }  
 	 }  
 	  
 	 / /   g e t   t h e   m i n i m i z e d   w i n d o w   c o u n t   b y   p a r e n t   e l e m e n  
 	 f u n c t i o n   g e t M i n W i n d o w L e n g t h ( p a r e n t )   {  
 	 	 p a r e n t   =   ( s e t t i n g . d o c k A r e a   ! =   n u l l ) ?   $ ( s e t t i n g . d o c k A r e a ) : p a r e n t ;  
 	 	 v a r   s t o r a g e   =   ( p a r e n t   ! =   n u l l ) ?   p a r e n t . g e t ( 0 ) . _ m i n W i n D a t a . s t o r a g e : m i n W i n D a t a . s t o r a g e ;  
 	 	 r e t u r n   s t o r a g e . l e n g t h ;  
 	 }  
 	  
 	 f u n c t i o n   c h e c k M i n W i n d o w S i z e ( p a r e n t ,   b P u s h )   {  
 	 	 v a r   b A d j u s t   =   f a l s e ;  
 	 	 v a r   r e c t   =   n u l l ;  
 	 	 v a r   m w d a t a   =   n u l l ;  
 	 	  
 	 	 / /   s e t   b o u n d a r y   r e c t   a n d   m i n i m i z e d   w i n d o w   d a t a  
 	 	 i f (   s e t t i n g . d o c k A r e a   ! =   n u l l   )   {  
 	 	 	 p a r e n t   =   $ ( s e t t i n g . d o c k A r e a ) ;  
 	 	 }  
 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 r e c t   =   { w i d t h : p a r e n t . i n n e r W i d t h ( ) ,   h e i g h t : p a r e n t . i n n e r H e i g h t ( ) } ;  
 	 	 	 m w d a t a   =   p a r e n t . g e t ( 0 ) . _ m i n W i n D a t a ;  
 	 	 }   e l s e   {  
 	 	 	 r e c t   =   g e t B r o w s e r S c r e e n W H ( ) ;  
 	 	 	 m w d a t a   =   m i n W i n D a t a ;  
 	 	 }  
 	 	  
 	 	 v a r   c o u n t   =   g e t M i n W i n d o w L e n g t h ( p a r e n t ) ;  
 	 	 i f (   s e t t i n g . d o c k   = =   ' l e f t '   | |   s e t t i n g . d o c k   = =   ' r i g h t '   )   {  
 	 	 	 i f (   b P u s h   )   {  
 	 	 	 	 i f (   ( ( c o u n t + 1 )   *   m w d a t a . l o n g )   >   r e c t . h e i g h t   )   {  
 	 	 	 	 	 m w d a t a . l o n g   =   r e c t . h e i g h t / ( c o u n t + 1 ) ;  
 	 	 	 	 	 a d j u s t A l l M i n W i n d o w s ( p a r e n t ) ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   i f (   m w d a t a . l o n g   <   s e t t i n g . m i n W i n L o n g   )   {  
 	 	 	 	 i f (   ( c o u n t   *   s e t t i n g . m i n W i n L o n g )   <   r e c t . h e i g h t   )   {  
 	 	 	 	 	 m w d a t a . l o n g   =   s e t t i n g . m i n W i n L o n g ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 m w d a t a . l o n g   =   r e c t . h e i g h t / c o u n t ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }   e l s e   i f (   s e t t i n g . d o c k   = =   ' t o p '   | |   s e t t i n g . d o c k   = =   ' b o t t o m '   )   {  
 	 	 	 i f (   b P u s h   )   {  
 	 	 	 	 i f (   ( ( c o u n t + 1 )   *   m w d a t a . l o n g )   >   r e c t . w i d t h   )   {  
 	 	 	 	 	 m w d a t a . l o n g   =   r e c t . w i d t h / ( c o u n t + 1 ) ;  
 	 	 	 	 	 a d j u s t A l l M i n W i n d o w s ( p a r e n t ) ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   i f (   m w d a t a . l o n g   <   s e t t i n g . m i n W i n L o n g   )   {  
 	 	 	 	 i f (   ( c o u n t   *   s e t t i n g . m i n W i n L o n g )   <   r e c t . w i d t h   )   {  
 	 	 	 	 	 m w d a t a . l o n g   =   s e t t i n g . m i n W i n L o n g ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 m w d a t a . l o n g   =   r e c t . w i d t h / c o u n t ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 	  
 	 f u n c t i o n   a d j u s t A l l M i n W i n d o w s ( p a r e n t )   {  
 	 	 p a r e n t   =   ( s e t t i n g . d o c k A r e a   ! =   n u l l ) ?   $ ( s e t t i n g . d o c k A r e a ) : p a r e n t ;  
 	 	 v a r   s t o r a g e   =   ( p a r e n t   ! =   n u l l ) ?   p a r e n t . g e t ( 0 ) . _ m i n W i n D a t a . s t o r a g e : m i n W i n D a t a . s t o r a g e ;  
 	 	 f o r (   v a r   i = 0 ;   i < s t o r a g e . l e n g t h ;   i + +   )   {  
 	 	 	 s t o r a g e [ i ] . _ a d j u s t M i n i m i z e d P o s ( f a l s e ) ;  
 	 	 }  
 	 }  
 	  
 	 / /   h i d e   b r o w s e r   s c r o l l   b a r  
 	 f u n c t i o n   h i d e B r o w s e r S c r o l l b a r ( )   {  
 	 	 i f (   s e t t i n g . h a n d l e S c r o l l b a r   )   {  
 	 	 	 i f (   u a . i n d e x O f ( " m s i e   7 " )   > =   0   )   {   / /   f i x   I E 7  
 	 	 	 	 $ ( " b o d y " ) . a t t r ( " s c r o l l " ,   " n o " ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 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   =   " h i d d e n " ;  
 	 	 	 }  
 	 	 }  
 	 }  
 	  
 	 / /   s h o w   b r o w s e r   s c r o l l   b a r  
 	 f u n c t i o n   s h o w B r o w s e r S c r o l l b a r ( )   {  
 	 	 i f (   s e t t i n g . h a n d l e S c r o l l b a r   )   {  
 	 	 	 i f (   u a . i n d e x O f ( " m s i e   7 " )   > =   0   )   {   / /   f i x   I E 7  
 	 	 	 	 $ ( " b o d y " ) . r e m o v e A t t r ( " s c r o l l " ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 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   =   " a u t o " ;  
 	 	 	 }  
 	 	 }  
 	 }  
 	  
 	 f u n c t i o n   g e t B r o w s e r S c r e e n W H ( )   {  
 	 	 v a r   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 a r   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 ;  
 	 	 r e t u r n   { w i d t h : w i d t h ,   h e i g h t : h e i g h t } ;  
 	 }  
  
 	 f u n c t i o n   g e t B r o w s e r S c r o l l X Y ( )   {  
 	 	 v a r   s c r O f X   =   0 ,   s c r O f Y   =   0 ;  
 	 	 i f (   t y p e o f (   w i n d o w . p a g e Y O f f s e t   )   = =   ' n u m b e r '   )   {  
 	 	 	 / / N e t s c a p e   c o m p l i a n t  
 	 	 	 s c r O f Y   =   w i n d o w . p a g e Y O f f s e t ;  
 	 	 	 s c r O f X   =   w i n d o w . p a g e X O f f s e t ;  
 	 	 }   e l s e   i f (   d o c u m e n t . b o d y   & &   (   d o c u m e n t . b o d y . 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 T o p   )   )   {  
 	 	 	 / / D O M   c o m p l i a n t  
 	 	 	 s c r O f Y   =   d o c u m e n t . b o d y . s c r o l l T o p ;  
 	 	 	 s c r O f X   =   d o c u m e n t . b o d y . s c r o l l L e f t ;  
 	 	 }   e l s e   i f (   d o c u m e n t . d o c u m e n t E l e m e n t   & &   (   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 L e f t   | |   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   )   )   {  
 	 	 	 / / I E 6   s t a n d a r d s   c o m p l i a n t   m o d e  
 	 	 	 s c r O f Y   =   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 ;  
 	 	 	 s c r O f X   =   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 L e f t ;  
 	 	 }  
 	 	 r e t u r n   { l e f t : s c r O f X ,   t o p : s c r O f Y } ;  
 	 }  
 	  
 	 f u n c t i o n   g e t P a r e n t P a n e l S t a r t P o s ( p a r e n t ,   b W i t h o u t C h e c k A b s o l u t e )   {  
 	 	 v a r   p o s   =   n u l l ;  
 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 / /   c h e c k   p a n e l   i s   a b s o l u t e   p o s i t i o n ?  
 	 	 	 v a r   b A b s o l u t e   =   ( p a r e n t . c s s ( ' p o s i t i o n ' )   = =   ' a b s o l u t e ' ) ;  
 	 	 	 i f (   b A b s o l u t e   & &   ! b W i t h o u t C h e c k A b s o l u t e   )   {  
 	 	 	 	 p o s   =   { l e f t : 0 ,   t o p : 0 } ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 p o s   =   p a r e n t . o f f s e t ( ) ;  
 	 	 	 	 v a r   b T o p   =   p a r s e I n t (   p a r e n t . c s s ( ' b o r d e r T o p W i d t h ' )   ) ;  
 	 	 	 	 v a r   b L e f t   =   p a r s e I n t (   p a r e n t . c s s ( ' b o r d e r L e f t W i d t h ' )   ) ;  
 	 	 	 	 p o s . l e f t   + =   b L e f t ;  
 	 	 	 	 p o s . t o p   + =   b T o p ;  
 	 	 	 }  
 	 	 	 l o g (   ' s t a r t   p o s :   ' + p o s . l e f t + ' , ' + p o s . t o p ) ;  
 	 	 }  
 	 	 r e t u r n   p o s ;  
 	 }  
 	  
 	 f u n c t i o n   g e t C s s S t y l e B y D o c k ( p a r e n t ,   m i n i I n d e x )   {  
 	 	 v a r   t a r g e t C s s   =   { } ;  
 	 	 v a r   s c r e e n W H   =   g e t B r o w s e r S c r e e n W H ( ) ;  
 	 	 v a r   c p o s   =   n u l l ;  
 	 	 v a r   n a r r o w   =   s e t t i n g . m i n W i n N a r r o w ;  
 	 	 v a r   l o n g   =   m i n W i n D a t a . l o n g ;  
 	 	  
 	 	 i f (   s e t t i n g . d o c k A r e a   ! =   n u l l   )   {  
 	 	 	 / /   c h e c k   o r i g i n a l   p a r e n t   p a n e l  
 	 	 	 v a r   p O f f s e t   =   { l e f t : 0 ,   t o p : 0 } ;  
 	 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 	 v a r   b A b s o l u t e   =   ( p a r e n t . c s s ( ' p o s i t i o n ' )   = =   ' a b s o l u t e ' ) ;  
 	 	 	 	 i f (   b A b s o l u t e   )   {  
 	 	 	 	 	 p O f f s e t   =   g e t P a r e n t P a n e l S t a r t P o s ( p a r e n t ,   t r u e ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   s e t   p a r e n t   v a r i a b l e   a s   c u s t o m e r i z e d   d o c k   a r e a   p a n e l  
 	 	 	 p a r e n t   =   $ ( s e t t i n g . d o c k A r e a ) ;  
 	 	 	 c p o s   =   g e t P a r e n t P a n e l S t a r t P o s ( p a r e n t ,   t r u e ) ;  
 	 	 	 / /   s u b t r a c t   t h e   o f f s e t   d i s t a n c e  
 	 	 	 c p o s . l e f t   - =   p O f f s e t . l e f t ;  
 	 	 	 c p o s . t o p   - =   p O f f s e t . t o p ;  
 	 	 	 l o n g   =   p a r e n t . g e t ( 0 ) . _ m i n W i n D a t a . l o n g ;  
 	 	 }   e l s e   i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 c p o s   =   g e t P a r e n t P a n e l S t a r t P o s ( p a r e n t ) ;  
 	 	 	 l o n g   =   p a r e n t . g e t ( 0 ) . _ m i n W i n D a t a . l o n g ;  
 	 	 }  
 	 	  
 	 	 i f (   s e t t i n g . d o c k   = =   ' l e f t '   | |   s e t t i n g . d o c k   = =   ' r i g h t '   )   {  
 	 	 	 t a r g e t C s s . w i d t h   =   n a r r o w ;  
 	 	 	 t a r g e t C s s . h e i g h t   =   l o n g   -   1 ;  
 	 	 	 t a r g e t C s s . t o p   =   m i n i I n d e x   *   l o n g ;  
 	 	 	 i f (   s e t t i n g . d o c k   = =   ' l e f t '   )   {  
 	 	 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 	 	 t a r g e t C s s . t o p   + =   c p o s . t o p ;  
 	 	 	 	 	 t a r g e t C s s . l e f t   =   c p o s . l e f t ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 t a r g e t C s s . l e f t   =   0 ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   i f (   s e t t i n g . d o c k   = =   ' r i g h t '   )   {  
 	 	 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 	 	 t a r g e t C s s . t o p   + =   c p o s . t o p ;  
 	 	 	 	 	 t a r g e t C s s . l e f t   =   c p o s . l e f t   +   p a r e n t . w i d t h ( )   -   n a r r o w   -   2 ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 t a r g e t C s s . l e f t   =   s c r e e n W H . w i d t h   -   n a r r o w ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }   e l s e   i f (   s e t t i n g . d o c k   = =   ' t o p '   | |   s e t t i n g . d o c k   = =   ' b o t t o m '   )   {  
 	 	 	 t a r g e t C s s . w i d t h   =   l o n g   -   1 ;  
 	 	 	 t a r g e t C s s . h e i g h t   =   n a r r o w ;  
 	 	 	 t a r g e t C s s . l e f t   =   m i n i I n d e x   *   l o n g ;  
 	 	 	 i f (   s e t t i n g . d o c k   = =   ' t o p '   )   {  
 	 	 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 	 	 t a r g e t C s s . t o p   =   c p o s . t o p ;  
 	 	 	 	 	 t a r g e t C s s . l e f t   + =   c p o s . l e f t ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 t a r g e t C s s . t o p   =   0 ; 	  
 	 	 	 	 }  
 	 	 	 }   e l s e   i f (   s e t t i n g . d o c k   = =   ' b o t t o m '   )   {  
 	 	 	 	 i f (   p a r e n t   ! =   n u l l   )   {  
 	 	 	 	 	 t a r g e t C s s . t o p   =   c p o s . t o p   +   p a r e n t . h e i g h t ( )   -   n a r r o w   -   2 ;  
 	 	 	 	 	 t a r g e t C s s . l e f t   + =   c p o s . l e f t ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 t a r g e t C s s . t o p   =   s c r e e n W H . h e i g h t   -   n a r r o w ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 l o g (   t a r g e t C s s   ) ;  
 	 	 r e t u r n   t a r g e t C s s ;  
 	 }  
 	  
 	 / /   l o g   r e l a t i v e   f u n c t i o n s  
 	 f u n c t i o n   l o g ( m s g )   {  
 	 	 i f ( s e t t i n g . s h o w L o g   & &   w i n d o w . c o n s o l e   ! =   n u l l )   {  
 	 	 	 c o n s o l e . l o g ( m s g ) ;  
 	 	 }  
 	 }  
 	 f u n c t i o n   i n f o ( m s g )   {  
 	 	 i f ( w i n d o w . c o n s o l e   ! =   n u l l )   {  
 	 	 	 c o n s o l e . i n f o ( m s g ) ;  
 	 	 }  
 	 }  
 	 f u n c t i o n   w a r n ( m s g )   {  
 	 	 i f ( w i n d o w . c o n s o l e   ! =   n u l l )   {  
 	 	 	 c o n s o l e . w a r n ( m s g ) ;  
 	 	 }  
 	 }  
 	 f u n c t i o n   e r r o r ( m s g )   {  
 	 	 i f ( w i n d o w . c o n s o l e   ! =   n u l l )   {  
 	 	 	 c o n s o l e . e r r o r ( m s g ) ;  
 	 	 }  
 	 }  
 	  
 	 f u n c t i o n   c o n s t r u c t o r ( c a l l e r ,   o p t i o n s )   {  
 	 	 / /   i n s t a n c e   p r i v a t e   m e t h o d s  
 	 	 / /   f l a g   &   v a r i a b l e s  
 	 	 v a r   _ t h i s   =   n u l l ;                                   / /   t o   r e m e m b e r   c u r r e n t   w i n d o w   i n s t a n c e  
 	 	 v a r   w i n d o w I d   =   " w i n d o w _ "   +   ( w i n d o w I n d e x + + ) ;   / /   t h e   w i n d o w ' s   i d  
 	 	 v a r   m i n i m i z e d   =   f a l s e ;                         / /   a   b o o l e a n   f l a g   t o   t e l l   t h e   w i n d o w   i s   m i n i m i z e d  
 	 	 v a r   m a x i m i z e d   =   f a l s e ;                         / /   a   b o o l e a n   f l a g   t o   t e l l   t h e   w i n d o w   i s   m a x i m i z e d  
 	 	 v a r   s e l e c t e d   =   f a l s e ;                           / /   a   b o o l e a n   f l a g   t o   t e l l   t h e   w i n d o w   i s   s e l e c t e d  
 	 	 v a r   r e d i r e c t C h e c k   =   f a l s e ;                 / /   a   b o o l e a n   f l a g   t o   c o n t r o l   p o p u p   m e s s a g e   w h i l e   b r o w s e r   i s   g o i n g   t o   l e a v e   t h i s   p a g e  
 	 	 v a r   p o s   =   n e w   O b j e c t ( ) ;                       / /   t o   s a v e   c a s c a d e   m o d e   c u r r e n t   p o s i t i o n  
 	 	 v a r   w h   =   n e w   O b j e c t ( ) ;                         / /   t o   s a v e   c a s c a d e   m o d e   c u r r e n t   w i d t h   &   h e i g h t  
 	 	 v a r   o r g P o s   =   n e w   O b j e c t ( ) ;                 / /   t o   s a v e   p o s i t i o n   b e f o r e   m i n i m i z e  
 	 	 v a r   o r g W h   =   n e w   O b j e c t ( ) ;                   / /   t o   s a v e   w i d t h   &   h e i g h t   b e f o r e   m i n i m i z e  
 	 	 v a r   t a r g e t C s s S t y l e   =   { } ;                     / /   t o   s a v e   t a r g e t   c s s   s t y l e   j s o n   o b j e c t  
 	 	 v a r   h e a d e r F u n c P a n e l   =   n u l l ;               / /   h e a d e r   f u n c t i o n   b a r   e l e m e n t   o b j e c t  
 	 	 v a r   f u n c B a r W i d t h   =   0 ;                           / /   t h e   w i d t h   o f   h e a d e r   f u n c t i o n   b a r  
 	 	 v a r   m i n i S t a c k I n d e x   =   - 1 ;                     / /   t h e   i n d e x   o f   w i n d o w   i n   m i n i m i z e d   s t a c k  
 	 	 v a r   a n i m a t i n g   =   f a l s e ;                         / /   a   b o o l e a n   f l a g   t o   i n d i c a t e   t h e   w i n d o w   i s   d o i n g   a n i m a t e  
 	 	 v a r   t e x t P a n e l W i d t h O f f s e t   =   0 ;           / /   t h e   w i d t h   o f f s e t   t h a t   t i t l e   t e x t   p a n e l   s h o u l d   d e c r e a s e  
 	 	  
 	 	 / /   e l e m e n t  
 	 	 v a r   c o n t a i n e r   =   n u l l ;                           / /   w h o l e   w i n d o w   c o n t a i n e r   e l e m e n t  
 	 	 v a r   h e a d e r   =   n u l l ;                                 / /   t h e   h e a d e r   p a n e l   o f   w i n d o w .   i t   i n c l u d e s   t i t l e   t e x t   a n d   b u t t o n s  
 	 	 v a r   f r a m e   =   n u l l ;                                   / /   t h e   c o n t e n t   p a n e l   o f   w i n d o w .   i t   c o u l d   b e   a   i f r a m e   o r   a   d i v   e l e m e n t ,   d e p e n d i n g   o n   w h i c h   w a y   y o u   c r e a t e   i t  
 	 	 v a r   f o o t e r   =   n u l l ;                                 / /   t h e   f o o t e r   p a n e l   o f   w i n d o w .   c u r r e n t l y ,   i t   g o t   n o t h i n g ,   b u t   m a y b e   a   s t a t u s   b a r   o r   s o m e t h i n g   w i l l   b e   a d d e d   i n   t h e   f u t u r e    
 	 	  
 	 	 / /   t h e   i n s t a n c e   o p t i o n s  
 	 	 v a r   o p t i o n s   =   $ . e x t e n d ( {  
 	 	 	 i c o n :   " a u t o " ,                                   / /   [ s t r i n g : " a u t o " ]   a   i c o n   i m a g e   u r l   s t r i n g .   i f   t h i s   a t t r i b u t e   i s   g i v e n ,   i t   w i l l   f o r c e   t o   r e p l a c e   t h e   o r i g i n a l   f a v i c o n   o f   r e m o t e   p a g e   o n   w i n d o w .  
 	 	 	                                                             / /   o r   y o u   c a n   s e t   i t   a s   n u l l   t o   h i d e   i c o n .  
 	 	 	 t i t l e :   " " ,                                         / /   [ s t r i n g : " " ]   t h e   t i t l e   t e x t   o f   w i n d o w  
 	 	 	 u r l :   " " ,                                             / /   [ s t r i n g : " " ]   t h e   t a r g e t   u r l   o f   i f r a m e   r e a d y   t o   l o a d .  
 	 	 	 c o n t e n t :   " " ,                                     / /   [ h t m l   s t r i n g ,   j q u e r y   o b j e c t ,   e l e m e n t : " " ]   t h i s   a t t r i b u t e   o n l y   w o r k s   w h e n   u r l   i s   n u l l .   w h e n   p a s s i n g   a   j q u e r y   o b j e c t   o r   a   e l e m e n t ,   i t   w i l l   c l o n e   t h e   o r i g i n a l   o n e   t o   a p p e n d .  
 	 	 	 f o o t e r C o n t e n t :   " " ,                         / /   [ h t m l   s t r i n g ,   j q u e r y   o b j e c t ,   e l e m e n t : " " ]   s a m e   a s   c o n t e n t   a t t r i b u t e ,   b u t   i t ' s   p u t   o n   f o o t e r   p a n e l .  
 	 	 	 c o n t a i n e r C l a s s :   " " ,                       / /   [ s t r i n g : " " ]   c o n t a i n e r   e x t r a   c l a s s  
 	 	 	 h e a d e r C l a s s :   " " ,                             / /   [ s t r i n g : " " ]   h e a d e r   e x t r a   c l a s s  
 	 	 	 f r a m e C l a s s :   " " ,                               / /   [ s t r i n g : " " ]   f r a m e   e x t r a   c l a s s  
 	 	 	 f o o t e r C l a s s :   " " ,                             / /   [ s t r i n g : " " ]   f o o t e r   e x t r a   c l a s s  
 	 	 	 s e l e c t e d H e a d e r C l a s s :   " " ,             / /   [ s t r i n g : " " ]   s e l e c t e d   h e a d e r   e x t r a   c l a s s  
 	 	 	 x :   - 1 ,                                                 / /   [ n u m b e r : - 1 ]   t h e   x - a x i s   v a l u e   o n   s c r e e n ( o r   c a l l e r   e l e m e n t ) ,   i f   - 1   m e a n s   p u t   o n   s c r e e n ( o r   c a l l e r   e l e m e n t )   c e n t e r  
 	 	 	 y :   - 1 ,                                                 / /   [ n u m b e r : - 1 ]   t h e   y - a x i s   v a l u e   o n   s c r e e n ( o r   c a l l e r   e l e m e n t ) ,   i f   - 1   m e a n s   p u t   o n   s c r e e n ( o r   c a l l e r   e l e m e n t )   c e n t e r  
 	 	 	 z :   2 0 0 0 ,                                             / /   [ n u m b e r : 2 0 0 0 ]   t h e   c s s   z - i n d e x   v a l u e  
 	 	 	 w i d t h :   4 0 0 ,                                       / /   [ n u m b e r : 4 0 0 ]   w i n d o w   w i d t h  
 	 	 	 h e i g h t :   3 0 0 ,                                     / /   [ n u m b e r : 3 0 0 ]   w i n d o w   h e i g h t  
 	 	 	 m i n W i d t h :   2 0 0 ,                                 / /   [ n u m b e r : 2 0 0 ]   t h e   m i n i m u m   w i d t h ,   i f   - 1   m e a n s   n o   c h e c k i n g  
 	 	 	 m i n H e i g h t :   1 5 0 ,                               / /   [ n u m b e r : 1 5 0 ]   t h e   m i n i m u m   h e i g h t ,   i f   - 1   m e a n s   n o   c h e c k i n g  
 	 	 	 m a x W i d t h :   8 0 0 ,                                 / /   [ n u m b e r : 8 0 0 ]   t h e   m a x i m u m   w i d t h ,   i f   - 1   m e a n s   n o   c h e c k i n g  
 	 	 	 m a x H e i g h t :   6 0 0 ,                               / /   [ n u m b e r : 6 0 0 ]   t h e   m a x i m u m   h e i g h t ,   i f   - 1   m e a n s   n o   c h e c k i n g  
 	 	 	 s h o w M o d a l :   f a l s e ,                           / /   [ b o o l e a n : f a l s e ]   t o   c o n t r o l   s h o w   m o d a l   o n   b a c k g r o u n d  
 	 	 	 m o d a l O p a c i t y :   0 . 5 ,                         / /   [ n u m b e r : 0 . 5 ]   t h e   o p a c i t y   o f   m o d a l   d i a l o g  
 	 	 	 s h o w F o o t e r :   t r u e ,                           / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   s h o w   f o o t e r   p a n e l  
 	 	 	 s h o w R o u n d C o r n e r :   f a l s e ,               / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   d i s p l a y   w i n d o w   a s   r o u n d   c o r n e r  
 	 	 	 c l o s a b l e :   t r u e ,                               / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   w i n d o w   c l o s a b l e  
 	 	 	 m i n i m i z a b l e :   t r u e ,                         / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   w i n d o w   m i n i m i z a b l e  
 	 	 	 m a x i m i z a b l e :   t r u e ,                         / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   w i n d o w   m a x i m i z a b l e  
 	 	 	 b o o k m a r k a b l e :   t r u e ,                       / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   w i n d o w   w i t h   r e m o t e   u r l   c o u l d   b e   b o o k m a r k e d  
 	 	 	 d r a g g a b l e :   t r u e ,                             / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   w i n d o w   d r a g g a b l e  
 	 	 	 r e s i z a b l e :   t r u e ,                             / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   w i n d o w   r e s i z a b l e  
 	 	 	 s c r o l l a b l e :   t r u e ,                           / /   [ b o o l e a n : t r u e ]   t o   c o n t r o l   s h o w   s c r o l l   b a r   o r   n o t  
 	 	 	 c h e c k B o u n d a r y :   f a l s e ,                   / /   [ b o o l e a n : f a l s e ]   t o   c h e c k   w i n d o w   d i a l o g   o v e r f l o w   h t m l   b o d y   o r   c a l l e r   e l e m e n t  
 	 	 	 w i t h i n B r o w s e r W i n d o w :   f a l s e ,       / /   [ b o o l e a n : f a l s e ]   t o   l i m i t   w i n d o w   o n l y   c a n   b e   d r a g g e d   w i t h i n   b r o w s e r   w i n d o w .   t h i s   a t t r i b u t e   o n l y   w o r k s   w h e n   c h e c k B o u n d a r y   i s   t r u e   a n d   c a l l e r   i s   n u l l .    
 	 	 	 c u s t B t n s :   n u l l ,                               / /   [ j s o n   a r r a y : n u l l ]   t o   d e s c r i b e   t h e   c u s t o m i z e d   b u t t o n   d i s p l a y   &   c a l l b a c k   f u n c t i o n  
 	 	 	 o n O p e n :   n u l l ,                                   / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   c o n t a i n e r   i s   a d d e d   i n t o   b o d y  
 	 	 	 o n S h o w :   n u l l ,                                   / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   w h o l e   w i n d o w   d i s p l a y   r o u t i n e   i s   f i n i s h e d  
 	 	 	 o n C l o s e :   n u l l ,                                 / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   u s e r   c l i c k   c l o s e   b u t t o n  
 	 	 	 o n S e l e c t :   n u l l ,                               / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   u s e r   s e l e c t   t h e   w i n d o w  
 	 	 	 o n U n s e l e c t :   n u l l ,                           / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   w i n d o w   u n s e l e c t e d  
 	 	 	 o n D r a g :   n u l l ,                                   / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   w i n d o w   i s   g o i n g   t o   d r a g  
 	 	 	 a f t e r D r a g :   n u l l ,                             / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   a f t e r   w i n d o w   d r a g g e d  
 	 	 	 o n R e s i z e :   n u l l ,                               / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   w i n d o w   i s   g o i n g   t o   r e s i z e  
 	 	 	 a f t e r R e s i z e :   n u l l ,                         / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   a f t e r   w i n d o w   r e s i z e d  
 	 	 	 o n M i n i m i z e :   n u l l ,                           / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   w i n d o w   i s   g o i n g   t o   m i n i m i z e  
 	 	 	 a f t e r M i n i m i z e :   n u l l ,                     / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   a f t e r   w i n d o w   m i n i m i z e d  
 	 	 	 o n M a x i m i z e :   n u l l ,                           / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   w i n d o w   i s   g o i n g   t o   m a x i m i z e  
 	 	 	 a f t e r M a x i m i z e :   n u l l ,                     / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   a f t e r   w i n d o w   m a x i m i z e d  
 	 	 	 o n C a s c a d e :   n u l l ,                             / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   w i n d o w   i s   g o i n g   t o   c a s c a d e  
 	 	 	 a f t e r C a s c a d e :   n u l l ,                       / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   a f t e r   w i n d o w   c a s c a d e d  
 	 	 	 o n I f r a m e S t a r t :   n u l l ,                     / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   i f r a m e   r e a d y   t o   c o n n e c t   r e m o t i n g   u r l .   t h i s   a t t r i b u t e   o n l y   w o r k s   w h i l e   u r l   a t t r i b u t e   i s   g i v e n  
 	 	 	 o n I f r a m e E n d :   n u l l ,                         / /   [ f u n c t i o n : n u l l ]   a   c a l l b a c k   f u n c t i o n   w h i l e   i f r a m e   l o a d   f i n i s h e d .   t h i s   a t t r i b u t e   o n l y   w o r k s   w h i l e   u r l   a t t r i b u t e   i s   g i v e n  
 	 	 	 i f r a m e R e d i r e c t C h e c k M s g :   n u l l ,   / /   [ s t r i n g : n u l l ]   i f   n u l l   m e a n s   n o   c h e c k ,   o r   p a s s   a   s t r i n g   t o   s h o w   w a r n i n g   m e s s a g e   w h i l e   i f r a m e   i s   g o i n g   t o   r e d i r e c t  
 	 	 	 c r e a t e R a n d o m O f f s e t :   { x : 0 ,   y : 0 }   / /   [ j s o n   o b j e c t : { x : 0 ,   y : 0 } ]   r a n d o m   t h e   n e w   c r e a t e d   w i n d o w   p o s i t i o n ,   i t   o n l y   w o r k s   w h e n   o p t i o n s   x , y   v a l u e   b o t h   a r e   - 1  
 	 	 } ,   o p t i o n s ) ;  
 	 	  
 	 	 f u n c t i o n   i n i t i a l i z e ( i n s t a n c e )   {  
 	 	 	 _ t h i s   =   i n s t a n c e ;  
 	 	 	  
 	 	 	 i f (   o p t i o n s . s h o w M o d a l   )   {  
 	 	 	 	 s h o w O v e r l a y ( ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   b u i l d   h t m l  
 	 	 	 v a r   r e a l C a l l e r   =   c a l l e r   ! =   n u l l ?   c a l l e r : $ ( " b o d y " ) ;  
 	 	 	 v a r   c o r n e r C l a s s   =   o p t i o n s . s h o w R o u n d C o r n e r ?   " u i - c o r n e r - a l l   " : " " ;  
 	 	 	 r e a l C a l l e r . a p p e n d ( " < d i v   i d = ' " + w i n d o w I d + " '   c l a s s = ' w i n d o w _ p a n e l   " + c o r n e r C l a s s + o p t i o n s . c o n t a i n e r C l a s s + " ' > < / d i v > " ) ;  
 	 	 	 c o n t a i n e r   =   r e a l C a l l e r . c h i l d r e n ( " d i v # " + w i n d o w I d ) ;  
 	 	 	 i f ( c o n t a i n e r . l e n g t h = = 0 )   c o n t a i n e r   =   $ ( " # w i n d o w _ 0 " ) ;  
 	  
 	 	 	 / /   o n O p e n   c a l l   b a c k  
 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n O p e n )   )   {  
 	 	 	 	 o p t i o n s . o n O p e n ( _ t h i s ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 w h . w   =   o p t i o n s . w i d t h ;  
 	 	 	 w h . h   =   o p t i o n s . h e i g h t ;  
 	 	 	 c o n t a i n e r . w i d t h ( o p t i o n s . w i d t h ) ;  
 	 	 	 c o n t a i n e r . h e i g h t ( o p t i o n s . h e i g h t ) ;  
 	 	 	 c o n t a i n e r . c s s ( " z - i n d e x " ,   o p t i o n s . z ) ;  
 	 	 	 i f (   $ . b r o w s e r . m s i e   )   {   / /   T o   f i x   t h e   r i g h t   o r   b o t t o m   e d g e   o f   w i n d o w   c a n ' t   b e   t r i g g e r   t o   r e s i z e   w h i l e   s c r o l l b a r   a p p e a r s   o n   I E   b r o w s e r  
 	 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 	 p a d d i n g R i g h t :   1 ,  
 	 	 	 	 	 p a d d i n g B o t t o m :   1  
 	 	 	 	 } ) ;  
 	 	 	 }  
  
 	 	 	 i f (   o p t i o n s . x   > =   0   | |   o p t i o n s . y   > =   0   )   {  
 	 	 	 	 v a r   s c r o l l P o s   =   g e t B r o w s e r S c r o l l X Y ( ) ;  
 	 	 	 	 / /   s e t   p o s i t i o n   x  
 	 	 	 	 i f (   o p t i o n s . x   > =   0   )   {  
 	 	 	 	 	 v a r   p L e f t   =   0 ;  
 	 	 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 	 	 v a r   c p o s   =   g e t P a r e n t P a n e l S t a r t P o s ( c a l l e r ) ;  
 	 	 	 	 	 	 p L e f t   =   o p t i o n s . x   +   c p o s . l e f t ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 p L e f t   =   o p t i o n s . x   +   s c r o l l P o s . l e f t ;  
 	 	 	 	 	 }  
 	 	 	 	 	 c o n t a i n e r . c s s ( " l e f t " ,   p L e f t ) ;  
 	 	 	 	 }   e l s e   {   / /   p u t   o n   c e n t e r  
 	 	 	 	 	 a l i g n H o r i z o n t a l C e n t e r ( ) ;  
 	 	 	 	 }  
 	  
 	 	 	 	 / /   s e t   p o s i t i o n   y  
 	 	 	 	 i f (   o p t i o n s . y   > =   0   )   {  
 	 	 	 	 	 v a r   p T o p   =   0 ;  
 	 	 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 	 	 v a r   c p o s   =   g e t P a r e n t P a n e l S t a r t P o s ( c a l l e r ) ;  
 	 	 	 	 	 	 p T o p   =   o p t i o n s . y   +   c p o s . t o p ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 p T o p   =   o p t i o n s . y   +   s c r o l l P o s . t o p ;  
 	 	 	 	 	 }  
 	 	 	 	 	 c o n t a i n e r . c s s ( " t o p " ,   p T o p ) ;  
 	 	 	 	 }   e l s e   {   / /   p u t   o n   m i d d l e  
 	 	 	 	 	 a l i g n V e r t i c a l C e n t e r ( ) ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   {  
 	 	 	 	 a l i g n C e n t e r ( ) ;  
 	 	 	 }  
 	 	 	 / /   f e e d   x , y   w i t h   r e a l   p i x e l   v a l u e ( n o t   a   p e r c e n t a g e ) ,   t o   a v o i d   " J U M P I N G "   w h i l e   w i n d o w   r e s t o r e   f r o m   m i n i z e d   s t a t u s  
 	 	 	 v a r   c u r r P o s   =   c o n t a i n e r . p o s i t i o n ( ) ;  
 	 	 	 i f ( c o n t a i n e r . l e n g t h = = 0 )   v a r   c u r r P o s   =   $ ( " # w i n d o w _ 0 " ) . p o s i t i o n ( )  
 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 l e f t :   c u r r P o s . l e f t ,  
 	 	 	 	 t o p :   c u r r P o s . t o p  
 	 	 	 } ) ;  
 	 	 	  
 	 	 	 / /   p r e p a r e   f a v i c o n   u r l  
 	 	 	 i f (   o p t i o n s . i c o n   = =   " a u t o "   )   {  
 	 	 	 	 o p t i o n s . i c o n   =   _ p r e p a r e F a v i c o n U r l ( ) ;  
 	 	 	 }  
 	 	 	 v a r   i c o n H t m l   =   ' ' ;  
 	 	 	 i f (   o p t i o n s . i c o n   ! =   n u l l   )   {  
 	 	 	 	 i c o n H t m l   =   " < i m g   c l a s s = ' w i n d o w _ t i t l e _ i c o n '   s r c = ' " + o p t i o n s . i c o n + " '   s t y l e = ' d i s p l a y : n o n e ; '   o n l o a d = ' j a v a s c r i p t : $ . W i n d o w . _ i c o n O n L o a d ( t h i s ) ; ' / > " ;  
 	 	 	 }  
 	  
 	 	 	 / /   b u i l d   h e a d e r   h t m l  
 	 	 	 c o r n e r C l a s s   =   o p t i o n s . s h o w R o u n d C o r n e r ?   " u i - c o r n e r - t o p   " : " " ;  
 	 	 	 v a r   h e a d e r H t m l   =   " < d i v   c l a s s = ' w i n d o w _ h e a d e r   w i n d o w _ h e a d e r _ n o r m a l   u i - w i d g e t - h e a d e r   " + c o r n e r C l a s s + " n o - r e s i z a b l e   " + o p t i o n s . h e a d e r C l a s s + " ' > " +  
 	 	 	 	 i c o n H t m l +  
 	 	 	 	 " < d i v   c l a s s = ' w i n d o w _ t i t l e _ t e x t ' > " + o p t i o n s . t i t l e + " < / d i v > " +  
 	 	 	 	 " < d i v   c l a s s = ' w i n d o w _ f u n c t i o n _ b a r ' > < / d i v > " +  
 	 	 	 	 " < / d i v > " ;  
 	 	 	 c o n t a i n e r . a p p e n d ( h e a d e r H t m l ) ;  
 	 	 	 h e a d e r   =   c o n t a i n e r . c h i l d r e n ( " d i v . w i n d o w _ h e a d e r " ) ;  
 	 	 	 h i d e I c o n ( ) ;  
 	 	 	  
 	 	 	 / /   b i n d   d o u b l e   c l i c k   e v e n t   w i t h   d o i n g   m a x i m i z e   a c t i o n  
 	 	 	 i f (   o p t i o n s . m a x i m i z a b l e   )   {  
 	 	 	 	 h e a d e r . d b l c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 i f (   m a x i m i z e d   )   {  
 	 	 	 	 	 	 r e s t o r e ( ) ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 m a x i m i z e ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 h e a d e r F u n c P a n e l   =   h e a d e r . c h i l d r e n ( " d i v . w i n d o w _ f u n c t i o n _ b a r " ) ;  
 	 	 	 / /   a d d   c l o s e   b u t t o n  
 	 	 	 i f (   o p t i o n s . c l o s a b l e   )   {  
 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   " < d i v   t i t l e = ' c l o s e   w i n d o w '   c l a s s = ' c l o s e I m g   w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e ' > < / d i v > "   ) ;  
 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . c l o s e I m g " ) . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 c l o s e ( ) ;  
 	 	 	 	 } ) ;  
 	 	 	 	 f u n c B a r W i d t h   + =   I C O N _ O F F S E T ;  
 	 	 	 }  
 	  
 	 	 	 / /   a d d   m a x i m i z e   b u t t o n  
 	 	 	 i f (   o p t i o n s . m a x i m i z a b l e   )   {  
 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   " < d i v   t i t l e = ' m a x i m i z e   w i n d o w '   c l a s s = ' m a x i m i z e I m g   w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e ' > < / d i v > "   ) ;  
 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   " < d i v   t i t l e = ' c a s c a d e   w i n d o w '   c l a s s = ' c a s c a d e I m g   w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e '   s t y l e = ' d i s p l a y : n o n e ; ' > < / d i v > "   ) ;  
 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . m a x i m i z e I m g " ) . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 m a x i m i z e ( ) ;  
 	 	 	 	 } ) ;  
 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . c a s c a d e I m g " ) . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 r e s t o r e ( ) ;  
 	 	 	 	 } ) ;  
 	 	 	 	 f u n c B a r W i d t h   + =   I C O N _ O F F S E T ;  
 	 	 	 }  
 	  
 	 	 	 / /   a d d   m i n i m i z e   b u t t o n  
 	 	 	 i f (   o p t i o n s . m i n i m i z a b l e   )   {  
 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   " < d i v   t i t l e = ' m i n i m i z e   w i n d o w '   c l a s s = ' m i n i m i z e I m g   w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e ' > < / d i v > "   ) ;  
 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . m i n i m i z e I m g " ) . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 m i n i m i z e ( ) ;  
 	 	 	 	 } ) ;  
 	 	 	 	 f u n c B a r W i d t h   + =   I C O N _ O F F S E T ;  
 	 	 	 }  
 	  
 	 	 	 / /   a d d   b o o k m a r k   b u t t o n  
 	 	 	 i f (   o p t i o n s . b o o k m a r k a b l e   & &   o p t i o n s . u r l   ! =   n u l l   & &   $ . t r i m ( o p t i o n s . u r l )   ! =   " "   )   {  
 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   " < d i v   t i t l e = ' b o o k m a r k   t h i s '   c l a s s = ' b o o k m a r k I m g   w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e ' > < / d i v > "   ) ;  
 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . b o o k m a r k I m g " ) . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 d o B o o k m a r k ( o p t i o n s . t i t l e ,   o p t i o n s . u r l ) ;  
 	 	 	 	 } ) ;  
 	 	 	 	 f u n c B a r W i d t h   + =   I C O N _ O F F S E T ;  
 	 	 	 }  
 	  
 	 	 	 / /   a d d   c u s t o m i z e d   b u t t o n s  
 	 	 	 a d d C u s t o m i z e d B u t t n s ( h e a d e r F u n c P a n e l ) ;  
 	 	 	  
 	 	 	 / /   m a k e   b u t t o n s   d o n ' t   p a s s   d b l c l i c k   e v e n t   t o   h e a d e r   p a n e l    
 	 	 	 $ ( " . w i n d o w _ i c o n _ b u t t o n " ) . d b l c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 } ) ;  
 	  
 	 	 	 / /   s e t   t e x t   &   f u n c t i o n   b a r   w i d t h  
 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 h e a d e r F u n c P a n e l . w i d t h (   f u n c B a r W i d t h   ) ;  
 	  
 	 	 	 / /   b u i l d   i f r a m e   h t m l  
 	 	 	 v a r   f r a m e H e i g h t   =   g e t F r a m e H e i g h t ( w h . h ) ;  
 	 	 	 i f (   o p t i o n s . u r l   ! =   n u l l   & &   $ . t r i m ( o p t i o n s . u r l )   ! =   " "   )   {  
 	 	 	 	 / /   i f r a m e   s t a r t i n g   c a l l   b a c k  
 	 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n I f r a m e S t a r t )   )   {  
 	 	 	 	 	 l o g ( " s t a r t   c o n n e c t i n g   i f r a m e :   " + o p t i o n s . u r l ) ;  
 	 	 	 	 	 o p t i o n s . o n I f r a m e S t a r t ( _ t h i s ,   o p t i o n s . u r l ) ;  
 	 	 	 	 }  
 	  
 	 	 	 	 / /   a d d   i f r a m e   r e d i r e c t   c h e c k i n g  
 	 	 	 	 i f (   o p t i o n s . i f r a m e R e d i r e c t C h e c k M s g   )   {  
 	 	 	 	 	 r e d i r e c t C h e c k   =   t r u e ;  
 	 	 	 	 	 w i n d o w . o n b e f o r e u n l o a d   =   f u n c t i o n ( )   {  
 	 	 	 	 	 	 i f (   r e d i r e c t C h e c k   )   {  
 	 	 	 	 	 	 	 v a r   m s g   =   o p t i o n s . i f r a m e R e d i r e c t C h e c k M s g . r e p l a c e ( " { u r l } " ,   o p t i o n s . u r l ) ;  
 	 	 	 	 	 	 	 r e t u r n   m s g ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	  
 	 	 	 	 / /   s h o w   l o a d i n g   i m a g e  
 	 	 	 	 c o n t a i n e r . a p p e n d ( " < d i v   c l a s s = ' f r a m e _ l o a d i n g '   s t y l e = ' b a c k g r o u n d :   t r a n s p a r e n t ; ' > 03@C7:0. . . < / d i v > " ) ;  
 	 	 	 	 v a r   l o a d i n g   =   c o n t a i n e r . c h i l d r e n ( " . f r a m e _ l o a d i n g " ) ;  
 	 	 	 	 l o a d i n g . c s s ( " m a r g i n L e f t " , 	 ' - '   +   ( l o a d i n g . o u t e r W i d t h ( )   /   2 )   -   2 0   +   ' p x ' ) ;  
 	 	 	 	 l o a d i n g . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 l o a d i n g . r e m o v e ( ) ;  
 	 	 	 	 } ) ;  
 	  
 	 	 	 	 / /   a p p e n d   i f r a m e   h t m l  
 	 	 	 	 v a r   s c r o l l i n g H t m l   =   o p t i o n s . s c r o l l a b l e ?   " y e s " : " n o " ;  
 	 	 	 	 c o n t a i n e r . a p p e n d ( " < i f r a m e   s t y l e = ' d i s p l a y : n o n e ; '   a l l o w T r a n s p a r e n c y = ' t r u e '   c l a s s = ' w i n d o w _ f r a m e   u i - w i d g e t - c o n t e n t   n o - d r a g g a b l e   n o - r e s i z a b l e   " + o p t i o n s . f r a m e C l a s s + " '   s c r o l l i n g = ' " + s c r o l l i n g H t m l + " '   s r c = ' " + o p t i o n s . u r l + " '   w i d t h = ' 1 0 0 % '   h e i g h t = ' " + f r a m e H e i g h t + " p x '   f r a m e b o r d e r = ' 0 ' > < / i f r a m e > " ) ;  
 	 	 	 	 f r a m e   =   c o n t a i n e r . c h i l d r e n ( " . w i n d o w _ f r a m e " ) ;  
 	  
 	 	 	 	 / /   i f r a m e   l o a d   f i n i s h e d   c a l l   b a c k  
 	 	 	 	 f r a m e . r e a d y ( f u n c t i o n ( )   {  
 	 	 	 	 	 f r a m e . s h o w ( ) ;  
 	 	 	 	 } ) ;  
 	  
 	 	 	 	 f r a m e . l o a d ( f u n c t i o n ( )   {  
 	 	 	 	 	 r e d i r e c t C h e c k   =   f a l s e ;  
 	 	 	 	 	 l o a d i n g . r e m o v e ( ) ;  
 	 	 	 	 	 l o g ( " l o a d   i f r a m e   f i n i s h e d :   " + o p t i o n s . u r l ) ;  
 	 	 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n I f r a m e E n d )   )   {  
 	 	 	 	 	 	 o p t i o n s . o n I f r a m e E n d ( _ t h i s ,   o p t i o n s . u r l ) ;  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 c o n t a i n e r . a p p e n d ( " < d i v   c l a s s = ' w i n d o w _ f r a m e   u i - w i d g e t - c o n t e n t   n o - d r a g g a b l e   n o - r e s i z a b l e   " + o p t i o n s . f r a m e C l a s s + " '   s t y l e = ' w i d t h : 1 0 0 % ;   h e i g h t : " + f r a m e H e i g h t + " p x ; ' > < / d i v > " ) ;  
 	 	 	 	 f r a m e   =   c o n t a i n e r . c h i l d r e n ( " . w i n d o w _ f r a m e " ) ;  
 	 	 	 	 i f (   o p t i o n s . c o n t e n t   ! =   n u l l   )   {  
 	 	 	 	 	 s e t C o n t e n t ( o p t i o n s . c o n t e n t ) ;  
 	 	 	 	 	 f r a m e . c h i l d r e n ( ) . s h o w ( ) ;  
 	 	 	 	 }  
 	 	 	 	 f r a m e . c s s ( {  
 	 	 	 	 	 o v e r f l o w :   o p t i o n s . s c r o l l a b l e ?   " a u t o " : " h i d d e n "  
 	 	 	 	 } ) ;  
 	 	 	 }  
 	  
 	 	 	 / /   b u i l d   f o o t e r   h t m l  
 	 	 	 i f (   o p t i o n s . s h o w F o o t e r   )   {  
 	 	 	 	 c o r n e r C l a s s   =   o p t i o n s . s h o w R o u n d C o r n e r ?   " u i - c o r n e r - b o t t o m   " : " " ;  
 	 	 	 	 c o n t a i n e r . a p p e n d ( " < d i v   c l a s s = ' w i n d o w _ f o o t e r   u i - w i d g e t - c o n t e n t   " + c o r n e r C l a s s + " n o - d r a g g a b l e   n o - r e s i z a b l e   " + o p t i o n s . f o o t e r C l a s s + " ' > < d i v > < / d i v > < / d i v > " ) ;  
 	 	 	 	 f o o t e r   =   c o n t a i n e r . c h i l d r e n ( " d i v . w i n d o w _ f o o t e r " ) ;  
 	 	 	 	 i f (   o p t i o n s . f o o t e r C o n t e n t   ! =   n u l l   )   {  
 	 	 	 	 	 s e t F o o t e r C o n t e n t ( o p t i o n s . f o o t e r C o n t e n t ) ;  
 	 	 	 	 	 f o o t e r . c h i l d r e n ( " d i v " ) . c h i l d r e n ( ) . s h o w ( ) ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   {  
 	 	 	 	 c o r n e r C l a s s   =   o p t i o n s . s h o w R o u n d C o r n e r ?   " u i - c o r n e r - b o t t o m   " : " " ;  
 	 	 	 	 f r a m e . a d d C l a s s ( c o r n e r C l a s s ) ;  
 	 	 	 }  
 	  
 	 	 	 / /   b i n d   c o n t a i n e r   h a n d l e   m o u s e d o w n   e v e n t  
 	 	 	 c o n t a i n e r . m o u s e d o w n ( f u n c t i o n ( )   {  
 	 	 	 	 s e l e c t W i n d o w ( c a l l e r ,   _ t h i s ) ;  
 	 	 	 } ) ;  
 	  
 	 	 	 / /   m a k e   w i n d o w   d r a g g a b l e  
 	 	 	 i f (   o p t i o n s . d r a g g a b l e   )   {  
 	 	 	 	 c o n t a i n e r . d r a g g a b l e ( {  
 	 	 	 	 	 c a n c e l :   " . n o - d r a g g a b l e " ,  
 	 	 	 	 	 s t a r t :   f u n c t i o n ( )   {  
 	 	 	 	 	 	 l o g (   " d r a g   s t a r t "   ) ;  
 	 	 	 	 	 	 i f (   m i n i m i z e d   | |   m a x i m i z e d   )   {   / /   i f   w i n d o w   i s   m i n i m i z e d   o r   m a x i m i z e d ,   r e s e t   t h e   c s s   s t y l e  
 	 	 	 	 	 	 	 c o n t a i n e r . c s s ( " p o s i t i o n " ,   " f i x e d " ) ;  
 	 	 	 	 	 	 	 c o n t a i n e r . c s s ( t a r g e t C s s S t y l e ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 s h o w O v e r l a y ( ) ;  
 	 	 	 	 	 	 h i d e C o n t e n t ( ) ;  
 	 	 	 	 	 	 / /   c a l l b a c k  
 	 	 	 	 	 	 i f (   o p t i o n s . o n D r a g   )   {  
 	 	 	 	 	 	 	 o p t i o n s . o n D r a g ( _ t h i s ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } ,  
 	 	 	 	 	 s t o p :   f u n c t i o n ( )   {  
 	 	 	 	 	 	 l o g (   " d r a g   s t o p "   ) ;  
 	 	 	 	 	 	 i f (   m i n i m i z e d   | |   m a x i m i z e d   )   {   / /   i f   w i n d o w   i s   m i n i m i z e d   o r   m a x i m i z e d ,   r e s e t   t h e   c s s   s t y l e  
 	 	 	 	 	 	 	 c o n t a i n e r . c s s ( " p o s i t i o n " ,   " f i x e d " ) ;  
 	 	 	 	 	 	 	 c o n t a i n e r . c s s ( t a r g e t C s s S t y l e ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 h i d e O v e r l a y ( ) ;  
 	 	 	 	 	 	 s h o w C o n t e n t ( ) ;  
 	 	 	 	 	 	 / /   c a l l b a c k  
 	 	 	 	 	 	 i f (   o p t i o n s . a f t e r D r a g   )   {  
 	 	 	 	 	 	 	 o p t i o n s . a f t e r D r a g ( _ t h i s ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 	 / /   s e t   b o u n d a r y   i f   g o t   o p o t i o n s  
 	 	 	 	 i f (   o p t i o n s . c h e c k B o u n d a r y   )   {  
 	 	 	 	 	 i f (   o p t i o n s . w i t h i n B r o w s e r W i n d o w   & &   c a l l e r   = =   n u l l   )   {  
 	 	 	 	 	 	 c o n t a i n e r . d r a g g a b l e ( ' o p t i o n ' ,   ' c o n t a i n m e n t ' ,   ' w i n d o w ' ) ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 c o n t a i n e r . d r a g g a b l e ( ' o p t i o n ' ,   ' c o n t a i n m e n t ' ,   ' p a r e n t ' ) ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	  
 	 	 	 / /   m a k e   w i n d o w   r e s i z a b l e  
 	 	 	 i f (   o p t i o n s . r e s i z a b l e   )   {  
 	 	 	 	 c o n t a i n e r . r e s i z a b l e ( {  
 	 	 	 	 	 c a n c e l :   " . n o - r e s i z a b l e " ,  
 	 	 	 	 	 a l s o R e s i z e :   f r a m e ,  
 	 	 	 	 	 s t a r t :   f u n c t i o n ( )   {   / /   t h i s   w i l l   b e   t r i g g e r e d   w h e n   w i n d o w   i s   g o i n g   t o   d r a g   i n   m i n i m i z e d   o r   m a x i m i z e d   m o d e  
 	 	 	 	 	 	 l o g (   " r e s i z e   s t a r t "   ) ;  
 	 	 	 	 	 	 i f (   m i n i m i z e d   | |   m a x i m i z e d   )   {   / /   i f   w i n d o w   i s   m i n i m i z e d   o r   m a x i m i z e d ,   r e s e t   t h e   c s s   s t y l e  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 s h o w O v e r l a y ( ) ;  
 	 	 	 	 	 	 h i d e C o n t e n t ( ) ;  
 	 	 	 	 	 	 / /   c a l l b a c k  
 	 	 	 	 	 	 i f (   o p t i o n s . o n R e s i z e   )   {  
 	 	 	 	 	 	 	 o p t i o n s . o n R e s i z e ( _ t h i s ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } ,  
 	 	 	 	 	 s t o p :   f u n c t i o n ( )   {  
 	 	 	 	 	 	 l o g (   " r e s i z e   s t o p "   ) ;  
 	 	 	 	 	 	 i f (   m i n i m i z e d   | |   m a x i m i z e d   )   {   / /   i f   w i n d o w   i s   m i n i m i z e d   o r   m a x i m i z e d ,   r e s e t   t h e   c s s   s t y l e  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 h i d e O v e r l a y ( ) ;  
 	 	 	 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 	 	 	 s h o w C o n t e n t ( ) ;  
 	 	 	 	 	 	 / /   c a l l b a c k  
 	 	 	 	 	 	 i f (   o p t i o n s . a f t e r R e s i z e   )   {  
 	 	 	 	 	 	 	 o p t i o n s . a f t e r R e s i z e ( _ t h i s ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 	 / /   s e t   b o u n d a r y   i f   g o t   o p o t i o n s  
 	 	 	 	 i f (   o p t i o n s . c h e c k B o u n d a r y   )   {  
 	 	 	 	 	 / /   t h i s   g o t   b u g ,   s o   m a r k   i t   t e m p o r a r i l y  
 	 	 	 	 	 / / c o n t a i n e r . r e s i z a b l e ( ' o p t i o n ' ,   ' c o n t a i n m e n t ' ,   " p a r e n t " ) ;  
 	 	 	 	 	 / / i f (   o p t i o n s . w i t h i n B r o w s e r W i n d o w   & &   c a l l e r   = =   n u l l   )   {  
 	 	 	 	 	 	 / / c o n t a i n e r . r e s i z a b l e ( ' o p t i o n ' ,   ' c o n t a i n m e n t ' ,   " w i n d o w " ) ;  
 	 	 	 	 	 / / }  
 	 	 	 	 }  
 	  
 	 	 	 	 / /   s e t   r e s i z e   m i n ,   m a x   w i d t h   &   h e i g h t  
 	 	 	 	 i f (   o p t i o n s . m a x W i d t h   > =   0   )   {  
 	 	 	 	 	 c o n t a i n e r . r e s i z a b l e ( ' o p t i o n ' ,   ' m a x W i d t h ' ,   o p t i o n s . m a x W i d t h ) ;  
 	 	 	 	 }  
 	 	 	 	 i f (   o p t i o n s . m a x H e i g h t   > =   0   )   {  
 	 	 	 	 	 c o n t a i n e r . r e s i z a b l e ( ' o p t i o n ' ,   ' m a x H e i g h t ' ,   o p t i o n s . m a x H e i g h t ) ;  
 	 	 	 	 }  
 	 	 	 	 i f (   o p t i o n s . m i n W i d t h   > =   0   )   {  
 	 	 	 	 	 c o n t a i n e r . r e s i z a b l e ( ' o p t i o n ' ,   ' m i n W i d t h ' ,   o p t i o n s . m i n W i d t h ) ;  
 	 	 	 	 }  
 	 	 	 	 i f (   o p t i o n s . m i n H e i g h t   > =   0   )   {  
 	 	 	 	 	 c o n t a i n e r . r e s i z a b l e ( ' o p t i o n ' ,   ' m i n H e i g h t ' ,   o p t i o n s . m i n H e i g h t ) ;  
 	 	 	 	 }  
 	 	 	 }  
  
 	 	 	 / /   o n S h o w   c a l l   b a c k  
 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n S h o w )   )   {  
 	 	 	 	 o p t i o n s . o n S h o w ( _ t h i s ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   g e t D o m a i n ( u r l )   {  
 	 	 	 v a r   t m p   =   u r l . m a t c h ( / : \ / \ / ( . [ ^ / ] + ) / ) ;  
 	 	 	 i f (   t m p   ! =   n u l l   & &   t m p . l e n g t h   > =   2   )   {  
 	 	 	 	 r e t u r n   t m p [ 1 ] ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 r e t u r n   n u l l ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 / /   i n s e r t   i c o n   e l e m e n t   h t m l ,   t h i s   s h o u l d   b e   c a l l   o n l y   w h e n   t h e   i c o n   d o e s n ' t   e x i s t  
 	 	 f u n c t i o n   _ a d d I c o n ( )   {  
 	 	 	 i f (   o p t i o n s . i c o n   ! =   n u l l   & &   o p t i o n s . i c o n   ! =   ' '   )   {  
 	 	 	 	 v a r   h t m l   =   " < i m g   c l a s s = ' w i n d o w _ t i t l e _ i c o n '   s r c = ' " + o p t i o n s . i c o n + " '   s t y l e = ' d i s p l a y : n o n e ; '   o n l o a d = ' j a v a s c r i p t : $ . W i n d o w . _ i c o n O n L o a d ( t h i s ) ; ' / > " ;  
 	 	 	 	 h e a d e r . p r e p e n d ( h t m l ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   s e t I c o n ( i c o n U r l )   {  
 	 	 	 o p t i o n s . i c o n   =   i c o n U r l ;  
 	 	 	  
 	 	 	 / /   p r e p a r e   f a v i c o n   u r l  
 	 	 	 i f (   o p t i o n s . i c o n   = =   " a u t o "   )   {  
 	 	 	 	 o p t i o n s . i c o n   =   _ p r e p a r e F a v i c o n U r l ( ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 i f (   o p t i o n s . i c o n   ! =   n u l l   )   {  
 	 	 	 	 v a r   i c o n   =   h e a d e r . c h i l d r e n ( ' . w i n d o w _ t i t l e _ i c o n ' ) ;  
 	 	 	 	 / /   c h e c k   i c o n   e l e m e n t   e x i s t e d ?  
 	 	 	 	 i f (   i c o n . g e t ( 0 )   ! =   n u l l   )   {   / /   h i d e   i c o n   a n d   s e t   i m a g e   s o u r c e   u r l  
 	 	 	 	 	 h i d e I c o n ( ) ;  
 	 	 	 	 	 i c o n . a t t r ( ' s r c ' ,   o p t i o n s . i c o n ) ; 	 	 	 	 	  
 	 	 	 	 }   e l s e   {   / /   i c o n   d o e s n ' t   e x i s t ,   i n s e r t   i c o n   e l e m e n t   h t m l  
 	 	 	 	 	 _ a d d I c o n ( ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 / /   s h o w   i c o n   e l e m e n t  
 	 	 f u n c t i o n   s h o w I c o n ( )   {  
 	 	 	 v a r   i c o n   =   h e a d e r . c h i l d r e n ( ' . w i n d o w _ t i t l e _ i c o n ' ) ;  
 	 	 	 i f (   i c o n . g e t ( 0 )   ! =   n u l l   )   {  
 	 	 	 	 i c o n . s h o w ( ) ;  
 	 	 	 	  
 	 	 	 	 / /   r e - a r r a n g e   t i t l e   t e x t   a r e a    
 	 	 	 	 v a r   t x t   =   h e a d e r . c h i l d r e n ( ' . w i n d o w _ t i t l e _ t e x t ' ) ;  
 	 	 	 	 t x t . c s s ( ' m a r g i n - l e f t ' ,   ' 0 ' ) ;  
 	 	 	 	 t e x t P a n e l W i d t h O f f s e t   =   2 0 ;  
 	 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 / /   h i d e   i c o n   e l e m e n t  
 	 	 f u n c t i o n   h i d e I c o n ( )   {  
 	 	 	 v a r   i c o n   =   h e a d e r . c h i l d r e n ( ' . w i n d o w _ t i t l e _ i c o n ' ) ;  
 	 	 	 i f (   i c o n . g e t ( 0 )   ! =   n u l l   )   {  
 	 	 	 	 i c o n . h i d e ( ) ;  
 	 	 	 	  
 	 	 	 	 / /   r e - a r r a n g e   t i t l e   t e x t   a r e a    
 	 	 	 	 v a r   t x t   =   h e a d e r . c h i l d r e n ( ' . w i n d o w _ t i t l e _ t e x t ' ) ;  
 	 	 	 	 t x t . c s s ( ' m a r g i n - l e f t ' ,   ' - 2 0 p x ' ) ;  
 	 	 	 	 t e x t P a n e l W i d t h O f f s e t   =   0 ;  
 	 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 / /   s e t   w i n d o w   t i t l e  
 	 	 f u n c t i o n   s e t T i t l e ( t i t l e )   {  
 	 	 	 o p t i o n s . t i t l e   =   t i t l e ;  
 	 	 	 h e a d e r . c h i l d r e n ( " . w i n d o w _ t i t l e _ t e x t " ) . t e x t ( t i t l e ) ;  
 	 	 	 i f (   m i n i m i z e d   )   {  
 	 	 	 	 _ t r a n s f o r m T i t l e T e x t ( ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 / /   g e t   w i n d o w   t i t l e  
 	 	 f u n c t i o n   g e t T i t l e ( )   {  
 	 	 	 r e t u r n   o p t i o n s . t i t l e ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   s e t U r l ( u r l )   {  
 	 	 	 o p t i o n s . u r l   =   u r l ;  
 	 	 	 f r a m e . a t t r ( " s r c " ,   u r l ) ;  
 	 	 	  
 	 	 	 i f (   o p t i o n s . i c o n   ! =   n u l l   )   {  
 	 	 	 	 s e t I c o n ( ' a u t o ' ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   _ p r e p a r e F a v i c o n U r l ( )   {  
 	 	 	 i f (   o p t i o n s . u r l   ! =   n u l l   & &   $ . t r i m ( o p t i o n s . u r l )   ! =   " "   )   {  
 	 	 	 	 v a r   d o m a i n   =   g e t D o m a i n ( o p t i o n s . u r l ) ;  
 	 	 	 	 i f (   d o m a i n   ! =   n u l l   )   {  
 	 	 	 	 	 r e t u r n   ' h t t p : / / ' + d o m a i n + ' / f a v i c o n . i c o ' ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 r e t u r n   n u l l ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   g e t U r l ( )   {  
 	 	 	 r e t u r n   o p t i o n s . u r l ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   s e t C o n t e n t ( c o n t e n t )   {  
 	 	 	 o p t i o n s . c o n t e n t   =   c o n t e n t ;  
 	 	 	 i f (   t y p e o f   c o n t e n t   = =   ' o b j e c t '   )   {  
 	 	 	 	 c o n t e n t   =   $ ( c o n t e n t ) . c l o n e ( t r u e ) ;  
 	 	 	 }   e l s e   i f (   t y p e o f   c o n t e n t   = =   ' s t r i n g '   )   {  
 	 	 	 	 / /   u s i n g   o r i g i n a l   c o n t e n t  
 	 	 	 }  
 	 	 	 f r a m e . e m p t y ( ) ;  
 	 	 	 f r a m e . a p p e n d ( c o n t e n t ) ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   g e t C o n t e n t ( )   {  
 	 	 	 r e t u r n   f r a m e . h t m l ( ) ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   s e t F o o t e r C o n t e n t ( c o n t e n t )   {  
 	 	 	 i f (   o p t i o n s . s h o w F o o t e r   )   {  
 	 	 	 	 o p t i o n s . f o o t e r C o n t e n t   =   c o n t e n t ;  
 	 	 	 	 i f (   t y p e o f   c o n t e n t   = =   ' o b j e c t '   )   {  
 	 	 	 	 	 c o n t e n t   =   $ ( c o n t e n t ) . c l o n e ( t r u e ) ;  
 	 	 	 	 }   e l s e   i f (   t y p e o f   c o n t e n t   = =   ' s t r i n g '   )   {  
 	 	 	 	 	 / /   u s i n g   o r i g i n a l   c o n t e n t  
 	 	 	 	 }  
 	 	 	 	 f o o t e r . c h i l d r e n ( " d i v " ) . e m p t y ( ) ;  
 	 	 	 	 f o o t e r . c h i l d r e n ( " d i v " ) . a p p e n d ( c o n t e n t ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   g e t F o o t e r C o n t e n t ( )   {  
 	 	 	 r e t u r n   f o o t e r . c h i l d r e n ( " d i v " ) . h t m l ( ) ;  
 	 	 }  
 	 	  
 	 	 / /   p o p u p   a   o v e r l a y   p a n e l   b l o c k   w h o l e   s c r e e n   w h i l e   w i n d o w   d r a g g i n g   o r   r e s i z i n g  
 	 	 / /   t o   a v o i d   l o s t   e v e n t   w h i l e   m o u s e   c u r s o r   o v e r   i f r a m e   r e g i o n .   [ I S U _ 0 0 3 ]  
 	 	 f u n c t i o n   s h o w O v e r l a y ( )   {  
 	 	 	 v a r   o v e r l a y   =   $ ( " # w i n d o w _ o v e r l a y " ) ;  
 	 	 	 i f (   o v e r l a y . g e t ( 0 )   = =   n u l l   )   {  
 	 	 	 	 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' w i n d o w _ o v e r l a y ' > & n b s p ; < / d i v > " ) ;  
 	 	 	 	 o v e r l a y   =   $ ( " # w i n d o w _ o v e r l a y " ) ;  
 	 	 	 	 o v e r l a y . c s s ( ' z - i n d e x ' ,   o p t i o n s . z + 1 ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 i f (   o p t i o n s . s h o w M o d a l   )   {  
 	 	 	 	 o v e r l a y . c s s ( {  
 	 	 	 	 	 o p a c i t y :   o p t i o n s . m o d a l O p a c i t y  
 	 	 	 	 } ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 o v e r l a y . c s s ( {  
 	 	 	 	 	 o p a c i t y :   0  
 	 	 	 	 } ) ;  
 	 	 	 }  
 	 	 	 o v e r l a y . s h o w ( ) ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   h i d e O v e r l a y ( b F o r c e )   {  
 	 	 	 i f (   o p t i o n s . s h o w M o d a l   = =   f a l s e   | |   b F o r c e   )   {  
 	 	 	 	 $ ( " # w i n d o w _ o v e r l a y " ) . h i d e ( ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   t r a n s f e r T o F i x e d ( )   {  
 	 	 	 v a r   c u r r P o s   =   c o n t a i n e r . o f f s e t ( ) ;  
 	 	 	 v a r   s c r o l l P o s   =   g e t B r o w s e r S c r o l l X Y ( ) ;  
 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 p o s i t i o n :   " f i x e d " ,   / /   t h i s   w i l l   c a u s e   I E   b r w o s e r   U I   e r r o r ,   S e e   I S U _ 0 0 4  
 	 	 	 	 l e f t :   c u r r P o s . l e f t   -   s c r o l l P o s . l e f t ,  
 	 	 	 	 t o p :   c u r r P o s . t o p   -   s c r o l l P o s . t o p  
 	 	 	 } ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   t r a n s f e r T o A b s o l u t e ( )   {  
 	 	 	 v a r   c u r r P o s   =   c o n t a i n e r . o f f s e t ( ) ;  
 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 p o s i t i o n :   " a b s o l u t e " ,  
 	 	 	 	 l e f t :   c u r r P o s . l e f t ,  
 	 	 	 	 t o p :   c u r r P o s . t o p  
 	 	 	 } ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   a d d C u s t o m i z e d B u t t n s ( h e a d e r F u n c P a n e l )   {  
 	 	 	 i f (   o p t i o n s . c u s t B t n s   ! =   n u l l   & &   t y p e o f   o p t i o n s . c u s t B t n s   = =   ' o b j e c t '   )   {  
 	 	 	 	 f o r (   v a r   i = 0 ;   i < o p t i o n s . c u s t B t n s . l e n g t h ;   i + +   )   {  
 	 	 	 	 	 v a r   b t n D a t a   =   o p t i o n s . c u s t B t n s [ i ] ;  
 	 	 	 	 	 i f (   b t n D a t a   ! =   n u l l   & &   t y p e o f   b t n D a t a   = =   ' o b j e c t '   )   {  
 	 	 	 	 	 	 i f (   b t n D a t a . i d   ! =   n u l l   & &   b t n D a t a . c a l l b a c k   ! =   n u l l   )   {   / /   i t ' s   a   J S O N   o b j e c t  
 	 	 	 	 	 	 	 v a r   i d   =   b t n D a t a . i d   ! =   n u l l ?   b t n D a t a . i d : " " ;  
 	 	 	 	 	 	 	 v a r   c l a z z   =   b t n D a t a . c l a z z   ! =   n u l l ?   b t n D a t a . c l a z z : " " ;  
 	 	 	 	 	 	 	 v a r   t i t l e   =   b t n D a t a . t i t l e   ! =   n u l l ?   b t n D a t a . t i t l e : " " ;  
 	 	 	 	 	 	 	 v a r   s t y l e   =   b t n D a t a . s t y l e   ! =   n u l l ?   b t n D a t a . s t y l e : " " ;  
 	 	 	 	 	 	 	 v a r   i m a g e   =   b t n D a t a . i m a g e   ! =   n u l l ?   b t n D a t a . i m a g e : " " ;  
 	 	 	 	 	 	 	 v a r   c a l l b a c k   =   b t n D a t a . c a l l b a c k   ! =   n u l l ?   b t n D a t a . c a l l b a c k : " " ;  
 	 	 	 	 	 	 	 i f (   b t n D a t a . i m a g e   ! =   n u l l   & &   b t n D a t a . i m a g e   ! =   " "   )   {  
 	 	 	 	 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   " < i m g   i d = ' " + i d + " '   s r c = ' " + i m a g e + " '   t i t l e = ' " + t i t l e + " '   c l a s s = ' " + c l a z z + "   w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e '   s t y l e = ' " + s t y l e + " ' / > "   ) ;  
 	 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   " < d i v   i d = ' " + i d + " '   s r c = ' " + i m a g e + " '   t i t l e = ' " + t i t l e + " '   c l a s s = ' " + c l a z z + "   w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e '   s t y l e = ' " + s t y l e + " ' > < / d i v > "   ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 v a r   b t n   =   h e a d e r F u n c P a n e l . c h i l d r e n ( " [ i d = " + i d + " ] " ) ;  
 	 	 	 	 	 	 	 b t n . g e t ( 0 ) . c l i c k C b   =   c a l l b a c k ;  
 	 	 	 	 	 	 	 i f (   $ . i s F u n c t i o n ( c a l l b a c k ) )   {  
 	 	 	 	 	 	 	 	 b t n . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 	 	 	 	 t h i s . c l i c k C b ( $ ( t h i s ) ,   _ t h i s ) ;  
 	 	 	 	 	 	 	 	 } ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }   e l s e   {   / /   i t ' s   a   h t m l   e l e m e n t ( o r   w r a p p e d   w i t h   j Q u e r y )  
 	 	 	 	 	 	 	 v a r   b t n   =   $ ( b t n D a t a ) . c l o n e ( t r u e ) ;  
 	 	 	 	 	 	 	 b t n . a d d C l a s s ( " w i n d o w _ i c o n _ b u t t o n   n o - d r a g g a b l e   c u s t _ b u t t o n " ) ;  
 	 	 	 	 	 	 	 h e a d e r F u n c P a n e l . a p p e n d (   b t n   ) ;  
 	 	 	 	 	 	 	 b t n . s h o w ( ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 f u n c B a r W i d t h   + =   I C O N _ O F F S E T ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   _ a d j u s t M i n i m i z e d P o s ( b I m m e d i a t e ,   c a l l b a c k )   {  
 	 	 	 a n i m a t i n g   =   t r u e ;  
 	 	 	 t a r g e t C s s S t y l e   =   g e t C s s S t y l e B y D o c k ( c a l l e r ,   m i n i S t a c k I n d e x ) ;  
 	 	 	 i f (   b I m m e d i a t e   )   {  
 	 	 	 	 c o n t a i n e r . c s s ( t a r g e t C s s S t y l e ) ;  
 	 	 	 	 a n i m a t i n g   =   f a l s e ;  
 	 	 	 	 i f (   $ . i s F u n c t i o n ( c a l l b a c k )   )   {  
 	 	 	 	 	 c a l l b a c k ( ) ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   {  
 	 	 	 	 c o n t a i n e r . a n i m a t e ( t a r g e t C s s S t y l e ,   s e t t i n g . a n i m a t i o n S p e e d ,   ' s w i n g ' ,   f u n c t i o n ( )   {  
 	 	 	 	 	 a n i m a t i n g   =   f a l s e ;  
 	 	 	 	 	 i f (   $ . i s F u n c t i o n ( c a l l b a c k )   )   {  
 	 	 	 	 	 	 c a l l b a c k ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   a d j u s t H e a d e r T e x t P a n e l W i d t h ( )   {  
 	 	 	 h e a d e r . c h i l d r e n ( " d i v . w i n d o w _ t i t l e _ t e x t " ) . w i d t h (   h e a d e r . w i d t h ( )   -   f u n c B a r W i d t h   -   t e x t P a n e l W i d t h O f f s e t   ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   a d j u s t F r a m e W H ( )   {  
 	 	 	 v a r   w i d t h   =   c o n t a i n e r . w i d t h ( ) ;  
 	 	 	 v a r   h e i g h t   =   c o n t a i n e r . h e i g h t ( ) ;  
 	 	 	 v a r   f r a m e H e i g h t   =   g e t F r a m e H e i g h t ( h e i g h t ) ;  
 	 	 	 f r a m e . w i d t h (   w i d t h   ) ;  
 	 	 	 f r a m e . h e i g h t (   f r a m e H e i g h t   ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   d o B o o k m a r k ( t i t l e ,   u r l )   {  
 	 	 	 i f   (   $ . b r o w s e r . m o z i l l a   & &   w i n d o w . s i d e b a r   )   {   / /   M o z i l l a   F i r e f o x   B o o k m a r k  
 	 	 	 	 w i n d o w . s i d e b a r . a d d P a n e l ( t i t l e ,   u r l ,   " " ) ;  
 	 	 	 }   e l s e   i f (   $ . b r o w s e r . m s i e   & &   w i n d o w . e x t e r n a l   )   {   / /   I E   F a v o r i t e  
 	 	 	 	 w i n d o w . e x t e r n a l . A d d F a v o r i t e (   u r l ,   t i t l e ) ;  
 	 	 	 }   e l s e   i f (   u a . i n d e x O f ( " c h r o m e " )   > =   0   )   {   / /   C h r o m e  
 	 	 	 	 a l e r t ( " S o r r y !   C h r o m e   d o e s n ' t   s u p p o r t   b o o k m a r k   f u n c t i o n   c u r r e n t l y . " ) ;  
 	 	 	 	 / / a l e r t ( " P r e s s   [ C t r l   +   D ]   t o   b o o k m a r k   i n   C h r o m e " ) ;  
 	 	 	 }   e l s e   i f ( $ . b r o w s e r . s a f a r i   | |   u a . i n d e x O f ( " s a f a r i " )   > =   0   )   {   / /   S a f a r i  
 	 	 	 	 a l e r t ( " S o r r y !   S a f a r i   d o e s n ' t   s u p p o r t   b o o k m a r k   f u n c t i o n   c u r r e n t l y . " ) ;  
 	 	 	 	 / / a l e r t ( " P r e s s   [ C t r l   +   D ]   t o   b o o k m a r k   i n   S a f a r i " ) ;  
 	 	 	 }   e l s e   i f ( $ . b r o w s e r . o p e r a   | |   u a . i n d e x O f ( " o p e r a " )   > =   0   )   {   / /   O p e r a   H o t l i s t  
 	 	 	 	 a l e r t ( " S o r r y !   O p e r a   d o e s n ' t   s u p p o r t   b o o k m a r k   f u n c t i o n   c u r r e n t l y . " ) ;  
 	 	 	 	 / / a l e r t ( " P r e s s   [ C t r l   +   D ]   t o   b o o k m a r k   i n   O p e r a " ) ;  
 	 	 	 }  
 	 	 }  
 	  
 	 	 f u n c t i o n   h i d e C o n t e n t ( )   {  
 	 	 	 v a r   b g C o l o r   =   f r a m e . c s s ( " b a c k g r o u n d C o l o r " ) ;  
 	 	 	 / / l o g ( " h i d e C o n t e n t :   " + b g C o l o r ) ;  
 	 	 	 i f (   b g C o l o r   ! =   n u l l   & &   b g C o l o r   ! =   " t r a n s p a r e n t "   & &   b g C o l o r   ! =   " r g b a ( 0 ,   0 ,   0 ,   0 ) "   )   {  
 	 	 	 	 c o n t a i n e r . c s s ( " b a c k g r o u n d C o l o r " ,   b g C o l o r ) ;  
 	 	 	 }  
 	 	 	 f r a m e . h i d e ( ) ;  
 	 	 	 i f (   o p t i o n s . s h o w F o o t e r   )   {  
 	 	 	 	 f o o t e r . h i d e ( ) ;  
 	 	 	 }  
 	 	 	 c o n t a i n e r . c s s ( " o p a c i t y " ,   O P A C I T Y _ M I N I M I Z E D ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   s h o w C o n t e n t ( )   {  
 	 	 	 / / l o g ( " s h o w C o n t e n t " ) ;  
 	 	 	 f r a m e . s h o w ( ) ;  
 	 	 	 i f (   o p t i o n s . s h o w F o o t e r   )   {  
 	 	 	 	 f o o t e r . s h o w ( ) ;  
 	 	 	 }  
 	 	 	 c o n t a i n e r . c s s ( " o p a c i t y " ,   1 ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   g e t F r a m e H e i g h t ( w i n d o w H e i g h t )   {  
 	 	 	 v a r   f o o t e r H e i g h t   =   o p t i o n s . s h o w F o o t e r ?   1 6 : 0 ;  
 	 	 	 r e t u r n   w i n d o w H e i g h t   -   2 0   -   f o o t e r H e i g h t   -   4 ;   / /   m i n u s   h e a d e r   &   f o o t e r   &   i f r a m e ' s   p a d d i n g   h e i g h t  
 	 	 }  
 	  
 	 	 / /   m o d i f y   t i t l e   t e x t   a s   v e r t i c a l   p r e s e n t a t i o n  
 	 	 f u n c t i o n   _ t r a n s f o r m T i t l e T e x t ( )   {  
 	 	 	 i f (   s e t t i n g . d o c k   = =   ' t o p '   | |   s e t t i n g . d o c k   = =   ' b o t t o m '   )   {  
 	 	 	 	 r e t u r n ;  
 	 	 	 }  
 	 	 	  
 	 	 	 v a r   t e x t B l o c k   =   h e a d e r . c h i l d r e n ( " d i v . w i n d o w _ t i t l e _ t e x t " ) ;  
 	 	 	 / /   c h e c k   i c o n   v i s i b l e  
 	 	 	 v a r   i c o n   =   h e a d e r . c h i l d r e n ( ' . w i n d o w _ t i t l e _ i c o n ' ) ;  
 	 	 	 i f (   i c o n . i s ( ' : v i s i b l e ' )   )   {  
 	 	 	 	 t e x t B l o c k . a d d C l a s s ( ' w i n d o w _ t i t l e _ t e x t _ v e r t i c a l _ w i t h _ i c o n ' ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 t e x t B l o c k . a d d C l a s s ( ' w i n d o w _ t i t l e _ t e x t _ v e r t i c a l ' ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 / / v a r   t e x t   =   t e x t B l o c k . t e x t ( ) ;  
 	 	 	 v a r   t e x t   =   o p t i o n s . t i t l e ;  
 	 	 	 v a r   b u f   =   " " ;  
 	 	 	  
 	 	 	 f o r (   v a r   i = 0 ;   i < t e x t . l e n g t h ;   i + +   )   {  
 	 	 	 	 v a r   c   =   t e x t . c h a r A t ( i ) ;  
 	 	 	 	 i f (   c   = =   " - "   | |   c   = =   " _ "   )   {  
 	 	 	 	 	 c   =   " | " ;  
 	 	 	 	 }  
 	 	 	 	 i f (   c   = =   "   "   )   {  
 	 	 	 	 	 c   =   " < d i v   s t y l e = ' h e i g h t : 5 p x ;   l i n e - h e i g h t : 5 p x ; ' > & n b s p ; < / d i v > " ;  
 	 	 	 	 	 b u f   + =   c ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 b u f   + =   c + " < b r > " ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 t e x t B l o c k . h t m l ( b u f ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   r e s t o r e T i t l e T e x t ( )   {  
 	 	 	 v a r   t e x t B l o c k   =   h e a d e r . c h i l d r e n ( " d i v . w i n d o w _ t i t l e _ t e x t " ) ;  
 	 	 	 t e x t B l o c k . r e m o v e C l a s s ( ' w i n d o w _ t i t l e _ t e x t _ v e r t i c a l ' ) ;  
 	 	 	 t e x t B l o c k . r e m o v e C l a s s ( ' w i n d o w _ t i t l e _ t e x t _ v e r t i c a l _ w i t h _ i c o n ' ) ;  
 	 	 	 t e x t B l o c k . t e x t ( o p t i o n s . t i t l e ) ;  
 	 	 }  
 	 	  
 	 	 / /   p u b l i c  
 	 	 f u n c t i o n   g e t C a l l e r ( )   {  
 	 	 	 r e t u r n   c a l l e r ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   g e t C o n t a i n e r ( )   {  
 	 	 	 r e t u r n   c o n t a i n e r ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   g e t H e a d e r ( )   {  
 	 	 	 r e t u r n   h e a d e r ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   g e t F r a m e ( )   {  
 	 	 	 r e t u r n   f r a m e ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   g e t F o o t e r ( )   {  
 	 	 	 r e t u r n   f o o t e r ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   g e t T a r g e t C s s S t y l e ( )   {  
 	 	 	 r e t u r n   t a r g e t C s s S t y l e ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   a l i g n C e n t e r ( )   {  
 	 	 	 v a r   p L e f t   =   0 ,   p T o p   =   0 ;  
 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 v a r   c p o s   =   g e t P a r e n t P a n e l S t a r t P o s ( c a l l e r ) ;  
 	 	 	 	 p L e f t   =   c p o s . l e f t   +   ( c a l l e r . w i d t h ( )   -   c o n t a i n e r . w i d t h ( ) )   /   2 ;  
 	 	 	 	 p T o p   =   c p o s . t o p   +   ( c a l l e r . h e i g h t ( )   -   c o n t a i n e r . h e i g h t ( ) )   /   2 ;  
 	 	 	 }   e l s e   { 	 	 	  
 	 	 	 	 v a r   s c r o l l P o s   =   g e t B r o w s e r S c r o l l X Y ( ) ;  
 	 	 	 	 v a r   s c r e e n W H   =   g e t B r o w s e r S c r e e n W H ( ) ;  
 	 	 	 	 p L e f t   =   s c r o l l P o s . l e f t   +   ( s c r e e n W H . w i d t h   -   c o n t a i n e r . w i d t h ( ) )   /   2 ;  
 	 	 	 	 p T o p   =   s c r o l l P o s . t o p   +   ( s c r e e n W H . h e i g h t   -   c o n t a i n e r . h e i g h t ( ) )   /   2 ;  
 	 	 	 } ;  
 	 	 	  
 	 	 	 / /   r a n d o m   n e w   c r e a t e d   w i n d o w   p o s i t i o n  
 	 	 	 i f (   o p t i o n s . c r e a t e R a n d o m O f f s e t . x   >   0   )   {  
 	 	 	 	 p L e f t   + =   ( ( M a t h . r a n d o m ( )   -   0 . 5 )   *   o p t i o n s . c r e a t e R a n d o m O f f s e t . x ) ;    
 	 	 	 }  
 	 	 	 i f (   o p t i o n s . c r e a t e R a n d o m O f f s e t . y   >   0   )   {  
 	 	 	 	 p T o p   + =   ( ( M a t h . r a n d o m ( )   -   0 . 5 )   *   o p t i o n s . c r e a t e R a n d o m O f f s e t . y ) ; 	 	 	 	 	  
 	 	 	 }  
 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 l e f t :   p L e f t ,  
 	 	 	 	 t o p :   p T o p  
 	 	 	 } ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   a l i g n H o r i z o n t a l C e n t e r ( )   {  
 	 	 	 v a r   p L e f t   =   0 ;  
 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 p L e f t   =   g e t P a r e n t P a n e l S t a r t P o s ( c a l l e r ) . l e f t   +   ( c a l l e r . w i d t h ( )   -   c o n t a i n e r . w i d t h ( ) )   /   2 ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 v a r   s c r o l l P o s   =   g e t B r o w s e r S c r o l l X Y ( ) ;  
 	 	 	 	 v a r   s c r e e n W H   =   g e t B r o w s e r S c r e e n W H ( ) ;  
 	 	 	 	 p L e f t   =   s c r o l l P o s . l e f t   +   ( s c r e e n W H . w i d t h   -   c o n t a i n e r . w i d t h ( ) )   /   2 ;  
 	 	 	 }  
 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 l e f t :   p L e f t  
 	 	 	 } ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   a l i g n V e r t i c a l C e n t e r ( )   {  
 	 	 	 v a r   p T o p   =   0 ;  
 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 p T o p   =   g e t P a r e n t P a n e l S t a r t P o s ( c a l l e r ) . t o p   +   ( c a l l e r . h e i g h t ( )   -   c o n t a i n e r . h e i g h t ( ) )   /   2 ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 v a r   s c r o l l P o s   =   g e t B r o w s e r S c r o l l X Y ( ) ;  
 	 	 	 	 v a r   s c r e e n W H   =   g e t B r o w s e r S c r e e n W H ( ) ;  
 	 	 	 	 p T o p   =   s c r o l l P o s . t o p   +   ( s c r e e n W H . h e i g h t   -   c o n t a i n e r . h e i g h t ( ) )   /   2 ;  
 	 	 	 }  
 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 t o p :   p T o p  
 	 	 	 } ) ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   s e l e c t ( )   {  
 	 	 	 s e l e c t e d   =   t r u e ;  
 	 	 	 i f (   m a x i m i z e d   = =   f a l s e   )   {  
 	 	 	 	 c o n t a i n e r . c s s ( ' z - i n d e x ' ,   o p t i o n s . z + 2 ) ;  
 	 	 	 	 i f (   o p t i o n s . s e l e c t e d H e a d e r C l a s s   )   {  
 	 	 	 	 	 h e a d e r . a d d C l a s s ( o p t i o n s . s e l e c t e d H e a d e r C l a s s ) ;   / /   a d d   s e l e c t e d   h e a d e r   c l a s s  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n S e l e c t )   )   {  
 	 	 	 	 o p t i o n s . o n S e l e c t ( ) ;  
 	 	 	 }  
 	 	 }  
 	  
 	 	 f u n c t i o n   u n s e l e c t ( )   {  
 	 	 	 s e l e c t e d   =   f a l s e ;  
 	 	 	 i f (   m a x i m i z e d   = =   f a l s e   )   {  
 	 	 	 	 c o n t a i n e r . c s s ( ' z - i n d e x ' ,   o p t i o n s . z ) ;  
 	 	 	 	 i f (   o p t i o n s . s e l e c t e d H e a d e r C l a s s   )   {  
 	 	 	 	 	 h e a d e r . r e m o v e C l a s s ( o p t i o n s . s e l e c t e d H e a d e r C l a s s ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n U n s e l e c t )   )   {  
 	 	 	 	 o p t i o n s . o n U n s e l e c t ( ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 / * *  
 	 	   *   @ p a r a m   x   -   t h e   a b s o l u t e   x - a x i s   v a l u e   o n   d o c u m e n t   o r   s h i f t   d i s t a n c e ,   i n   p i x e l s  
 	 	   *   @ p a r a m   y   -   t h e   a b s o l u t e   y - a x i s   v a l u e   o n   d o c u m e n t   o r   s h i f t   d i s t a n c e ,   i n   p i x e l s  
 	 	   *   @ p a r a m   b S h i f t   -   a   b o o l e a n   f l a g   t o   d e c i d e   t o   s h i f t   t h e   w i n d o w   p o s i t i o n   w i t h   x , y  
 	 	   * /  
 	 	 f u n c t i o n   m o v e ( x ,   y ,   b S h i f t )   {  
 	 	 	 i f (   ! m a x i m i z e d   & &   ! m i n i m i z e d   )   {  
 	 	 	 	 v a r   s t y l e O b j   =   { } ;  
 	 	 	 	 i f (   t y p e o f   x   = =   ' n u m b e r '   )   {  
 	 	 	 	 	 i f (   b S h i f t   )   {  
 	 	 	 	 	 	 v a r   c u r r P o s   =   c o n t a i n e r . o f f s e t ( ) ;  
 	 	 	 	 	 	 x   + =   c u r r P o s . l e f t ;  
 	 	 	 	 	 }  
 	 	 	 	 	 s t y l e O b j . l e f t   =   x ;  
 	 	 	 	 }  
 	 	 	 	 i f (   t y p e o f   y   = =   ' n u m b e r '   )   {  
 	 	 	 	 	 s t y l e O b j . t o p   =   y ;  
 	 	 	 	 	 i f (   b S h i f t   )   {  
 	 	 	 	 	 	 v a r   c u r r P o s   =   c o n t a i n e r . o f f s e t ( ) ;  
 	 	 	 	 	 	 y   + =   c u r r P o s . t o p ;  
 	 	 	 	 	 }  
 	 	 	 	 	 s t y l e O b j . t o p   =   y ;  
 	 	 	 	 }  
 	 	 	 	 c o n t a i n e r . c s s ( s t y l e O b j ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   r e s i z e ( w ,   h )   {  
 	 	 	 i f (   ! m a x i m i z e d   & &   ! m i n i m i z e d   )   {  
 	 	 	 	 v a r   s t y l e O b j   =   { } ;  
 	 	 	 	 i f (   w   >   0   )   {  
 	 	 	 	 	 s t y l e O b j . w i d t h   =   w ;  
 	 	 	 	 }  
 	 	 	 	 i f (   h   >   0   )   {  
 	 	 	 	 	 s t y l e O b j . h e i g h t   =   h ;  
 	 	 	 	 }  
 	 	 	 	 c o n t a i n e r . c s s ( s t y l e O b j ) ;  
 	 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 }  
 	 	 }  
 	  
 	 	 f u n c t i o n   m a x i m i z e ( b I m m e d i a t e l y ,   b N o S a v e D i s p l a y )   {  
 	 	 	 i f (   ! $ . b r o w s e r . m s i e   & &   c a l l e r   = =   n u l l   )   {   / /   i n   I E ,   m u s t   d o   h i d e   s c r o l l b a r   r o u t i n e   a f t e r   a n i m a t i o n   f i n i s h e d  
 	 	 	 	 h i d e B r o w s e r S c r o l l b a r ( ) ;  
 	 	 	 }  
 	 	 	 m a x i m i z e d   =   t r u e ;  
 	 	 	 c o n t a i n e r . d r a g g a b l e (   ' d i s a b l e '   ) ;  
 	 	 	 c o n t a i n e r . r e s i z a b l e (   ' d i s a b l e '   ) ;  
 	  
 	 	 	 / /   s a v e   c u r r e n t   d i s p l a y  
 	 	 	 i f (   b N o S a v e D i s p l a y   ! =   t r u e   )   {  
 	 	 	 	 p o s . l e f t   =   c o n t a i n e r . c s s ( " l e f t " ) ;  
 	 	 	 	 p o s . t o p   =   c o n t a i n e r . c s s ( " t o p " ) ;  
 	 	 	 	 w h . w   =   c o n t a i n e r . w i d t h ( ) ;  
 	 	 	 	 w h . h   =   c o n t a i n e r . h e i g h t ( ) ;  
 	 	 	 }  
 	 	 	 / /   m u s t   a d d   t h i s ,   o r   i t   w i l l   g e t   a   b u g   w h e n   u s e r   m o u s e   d o w n   t h e   b o r d e r   o f   w i n d o w   p a n e l   i f   i t   i s   r e s i z e d .  
 	 	 	 c o n t a i n e r . a d d C l a s s ( ' n o - r e s i z a b l e ' ) ;  
 	 	 	  
 	 	 	 v a r   s c r o l l P o s   =   g e t B r o w s e r S c r o l l X Y ( ) ;  
 	 	 	 v a r   s c r e e n W H   =   g e t B r o w s e r S c r e e n W H ( ) ;  
 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 v a r   c p o s   =   g e t P a r e n t P a n e l S t a r t P o s ( c a l l e r ) ;  
 	 	 	 	 t a r g e t C s s S t y l e   =   {  
 	 	 	 	 	 l e f t :   c p o s . l e f t ,  
 	 	 	 	 	 t o p :   c p o s . t o p ,  
 	 	 	 	 	 w i d t h :   c a l l e r . w i d t h ( ) ,  
 	 	 	 	 	 h e i g h t :   c a l l e r . h e i g h t ( ) ,  
 	 	 	 	 	 o p a c i t y :   1  
 	 	 	 	 } ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 t a r g e t C s s S t y l e   =   {  
 	 	 	 	 	 l e f t :   s c r o l l P o s . l e f t ,  
 	 	 	 	 	 t o p :   s c r o l l P o s . t o p ,  
 	 	 	 	 	 w i d t h :   s c r e e n W H . w i d t h ,  
 	 	 	 	 	 h e i g h t :   s c r e e n W H . h e i g h t ,  
 	 	 	 	 	 o p a c i t y :   1  
 	 	 	 	 } ;  
 	 	 	 }  
 	  
 	 	 	 i f (   b I m m e d i a t e l y   )   {  
 	 	 	 	 c o n t a i n e r . c s s ( t a r g e t C s s S t y l e ) ;  
 	 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 	 a d j u s t F r a m e W H ( ) ;  
 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' w i n d o w _ h e a d e r _ n o r m a l ' ) ;  
 	 	 	 	 h e a d e r . a d d C l a s s ( ' w i n d o w _ h e a d e r _ m a x i m i z e ' ) ;  
 	 	 	 	 / /   s w i t c h   m a x i m i z e ,   c a s c a d e   b u t t o n  
 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . m a x i m i z e I m g " ) . h i d e ( ) ;  
 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . c a s c a d e I m g " ) . s h o w ( ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 h i d e C o n t e n t ( ) ;  
 	 	 	 	 c o n t a i n e r . a n i m a t e ( t a r g e t C s s S t y l e ,   s e t t i n g . a n i m a t i o n S p e e d ,   ' s w i n g ' ,   f u n c t i o n ( )   {  
 	 	 	 	 	 i f (   $ . b r o w s e r . m s i e   & &   c a l l e r   = =   n u l l   )   {   / /   i n   I E ,   m u s t   d o   h i d e   s c r o l l b a r   r o u t i n e   a f t e r   a n i m a t i o n   f i n i s h e d  
 	 	 	 	 	 	 h i d e B r o w s e r S c r o l l b a r ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 s h o w C o n t e n t ( ) ;  
 	 	 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 	 	 a d j u s t F r a m e W H ( ) ;  
 	 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' w i n d o w _ h e a d e r _ n o r m a l ' ) ;  
 	 	 	 	 	 h e a d e r . a d d C l a s s ( ' w i n d o w _ h e a d e r _ m a x i m i z e ' ) ;  
 	 	 	 	 	 / /   s w i t c h   m a x i m i z e ,   c a s c a d e   b u t t o n  
 	 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . m a x i m i z e I m g " ) . h i d e ( ) ;  
 	 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . c a s c a d e I m g " ) . s h o w ( ) ;  
 	 	 	 	 	  
 	 	 	 	 	 / /   a f t e r   c a l l b a c k  
 	 	 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . a f t e r M a x i m i z e )   )   {  
 	 	 	 	 	 	 o p t i o n s . a f t e r M a x i m i z e ( _ t h i s ) ;  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 	 c o n t a i n e r . c s s ( ' z - i n d e x ' ,   o p t i o n s . z + 3 ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   b e f o r e   c a l l b a c k  
 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n M a x i m i z e )   )   {  
 	 	 	 	 o p t i o n s . o n M a x i m i z e ( _ t h i s ) ;  
 	 	 	 }  
 	 	 }  
 	  
 	 	 f u n c t i o n   m i n i m i z e ( )   {  
 	 	 	 h i d e O v e r l a y ( t r u e ) ;  
 	 	 	 s h o w B r o w s e r S c r o l l b a r ( ) ;  
 	 	 	 m i n i m i z e d   =   t r u e ;  
 	 	 	 c o n t a i n e r . d r a g g a b l e (   ' d i s a b l e '   ) ;  
 	 	 	 c o n t a i n e r . r e s i z a b l e (   ' d i s a b l e '   ) ;  
 	 	 	  
 	 	 	 / /   s a v e   c u r r e n t   d i s p l a y  
 	 	 	 o r g P o s . l e f t   =   c o n t a i n e r . c s s ( " l e f t " ) ;  
 	 	 	 o r g P o s . t o p   =   c o n t a i n e r . c s s ( " t o p " ) ;  
 	 	 	 o r g W h . w   =   c o n t a i n e r . w i d t h ( ) ;  
 	 	 	 o r g W h . h   =   c o n t a i n e r . h e i g h t ( ) ;  
  
 	 	 	 m i n i S t a c k I n d e x   =   g e t M i n W i n d o w L e n g t h ( c a l l e r ) ;  
 	 	 	 t a r g e t C s s S t y l e   =   {  
 	 	 	 	 o p a c i t y :   O P A C I T Y _ M I N I M I Z E D  
 	 	 	 } ;  
 	 	 	 / /   m u s t   a d d   t h i s ,   o r   i t   w i l l   g e t   a   b u g   w h e n   u s e r   m o u s e   d o w n   t h e   b o r d e r   o f   w i n d o w   p a n e l   i f   i t   i s   r e s i z e d .  
 	 	 	 c o n t a i n e r . a d d C l a s s ( ' n o - r e s i z a b l e ' ) ;  
 	 	 	  
 	 	 	 i f (   c a l l e r   = =   n u l l   & &   s e t t i n g . d o c k A r e a   = =   n u l l   )   {  
 	 	 	 	 t r a n s f e r T o F i x e d ( ) ;   / /   t r a n s f e r   p o s i t i o n   t o   f i x e d   f i r s t  
 	 	 	 }  
 	 	 	 h e a d e r F u n c P a n e l . h i d e ( ) ;  
 	 	 	 h i d e C o n t e n t ( ) ;  
 	 	 	  
 	 	 	 / /   c h e c k   m i n i m i z e d   w i n d o w s '   s i z e  
 	 	 	 c h e c k M i n W i n d o w S i z e ( c a l l e r ,   t r u e ) ;  
 	 	 	 _ a d j u s t M i n i m i z e d P o s ( f a l s e ,   f u n c t i o n ( )   {  
 	 	 	 	 c o n t a i n e r . c s s ( ' z - i n d e x ' ,   o p t i o n s . z ) ;  
 	 	 	 	 h e a d e r . c h i l d r e n ( " d i v . w i n d o w _ t i t l e _ t e x t " ) . w i d t h (   " 9 6 % "   ) ;  
 	 	 	 	 h e a d e r . a t t r ( " t i t l e " ,   o p t i o n s . t i t l e ) ;  
 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' w i n d o w _ h e a d e r _ n o r m a l ' ) ;  
 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' w i n d o w _ h e a d e r _ m a x i m i z e ' ) ;  
 	 	 	 	 h e a d e r . a d d C l a s s ( ' w i n d o w _ h e a d e r _ m i n i m i z e ' ) ;  
 	 	 	 	 i f (   s e t t i n g . d o c k   = =   ' l e f t '   | |   s e t t i n g . d o c k   = =   ' r i g h t '   )   {  
 	 	 	 	 	 h e a d e r . a d d C l a s s ( ' w i n d o w _ h e a d e r _ m i n i m i z e _ v e r t i c a l ' ) ;  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f (   o p t i o n s . s h o w R o u n d C o r n e r   )   {  
 	 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' u i - c o r n e r - t o p ' ) ;  
 	 	 	 	 	 h e a d e r . a d d C l a s s ( ' u i - c o r n e r - a l l ' ) ;  
 	 	 	 	 }  
 	 	 	 	 _ t r a n s f o r m T i t l e T e x t ( ) ;  
 	  
 	 	 	 	 / /   b i n d   h e a d e r   c l i c k   e v e n t  
 	 	 	 	 h e a d e r . c l i c k ( f u n c t i o n ( )   {  
 	 	 	 	 	 i f (   ! a n i m a t i n g   )   {  
 	 	 	 	 	 	 r e s t o r e ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 	  
 	 	 	 	 / /   a f t e r   c a l l b a c k  
 	 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . a f t e r M i n i m i z e )   )   {  
 	 	 	 	 	 o p t i o n s . a f t e r M i n i m i z e ( _ t h i s ) ;  
 	 	 	 	 }  
 	 	 	 } ) ;  
 	 	 	 c o n t a i n e r . m o u s e o v e r ( f u n c t i o n ( )   {  
 	 	 	 	 $ ( t h i s ) . c s s ( " o p a c i t y " ,   1 ) ;  
 	 	 	 } ) ;  
 	 	 	 c o n t a i n e r . m o u s e o u t ( f u n c t i o n ( )   {  
 	 	 	 	 $ ( t h i s ) . c s s ( " o p a c i t y " ,   O P A C I T Y _ M I N I M I Z E D ) ;  
 	 	 	 } ) ;  
 	 	 	  
 	 	 	 / /   b e f o r e   c a l l b a c k  
 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n M i n i m i z e )   )   {  
 	 	 	 	 o p t i o n s . o n M i n i m i z e ( _ t h i s ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   p u s h   i n t o   m i n i m i z e d   w i n d o w   s t o r a g e  
 	 	 	 p u s h M i n W i n d o w ( c a l l e r ,   _ t h i s ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   r e s t o r e ( )   {  
 	 	 	 i f (   o p t i o n s . s h o w M o d a l   )   {  
 	 	 	 	 s h o w O v e r l a y ( ) ;  
 	 	 	 }  
 	 	 	 v a r   r p o s   =   n u l l ;  
 	 	 	 v a r   r w h   =   n u l l ;  
 	 	 	 v a r   z I n d e x   =   o p t i o n s . z + 2 ;  
 	 	 	 i f (   m i n i m i z e d   )   {   / /   f r o m   m i n i m i z e d   s t a t u s  
 	 	 	 	 r p o s   =   o r g P o s ;  
 	 	 	 	 r w h   =   o r g W h ;  
 	 	 	 	 i f (   c a l l e r   = =   n u l l   )   {  
 	 	 	 	 	 t r a n s f e r T o A b s o l u t e ( ) ;   / /   t r a n s f e r   p o s i t i o n   t o   f i x e d   f i r s t  
 	 	 	 	 }  
 	 	 	 	 r e s t o r e T i t l e T e x t ( ) ;  
 	 	 	 	 h e a d e r . r e m o v e A t t r ( " t i t l e " ) ;  
 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' w i n d o w _ h e a d e r _ m i n i m i z e ' ) ;  
 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' w i n d o w _ h e a d e r _ m i n i m i z e _ v e r t i c a l ' ) ;  
 	 	 	 	 i f (   m a x i m i z e d   )   {   / /   m i n i m i z e d   - >   m a x i m i z e d  
 	 	 	 	 	 h e a d e r . a d d C l a s s ( ' w i n d o w _ h e a d e r _ m a x i m i z e ' ) ;  
 	 	 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 	 	 r p o s   =   g e t P a r e n t P a n e l S t a r t P o s ( c a l l e r ) ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 v a r   s c r o l l P o s   =   g e t B r o w s e r S c r o l l X Y ( ) ;  
 	 	 	 	 	 	 r p o s   =   {  
 	 	 	 	 	 	 	 l e f t :   s c r o l l P o s . l e f t ,  
 	 	 	 	 	 	 	 t o p :   s c r o l l P o s . t o p  
 	 	 	 	 	 	 } ;  
 	 	 	 	 	 }  
 	 	 	 	 	 z I n d e x   =   o p t i o n s . z + 3 ;  
 	 	 	 	 	 c o n t a i n e r . c s s ( ' z - i n d e x ' ,   z I n d e x ) ;   / /   c h a n g e   z - i n d e x   b e f o r e   a n i m a t i n g  
 	 	 	 	 }   e l s e   {   / /   m i n i m i z e d   - >   c a s c a d e  
 	 	 	 	 	 h e a d e r . a d d C l a s s ( ' w i n d o w _ h e a d e r _ n o r m a l ' ) ;  
 	 	 	 	 	 / /   m u s t   a d d   t h i s ,   o r   i t   w i l l   g e t   a   b u g   w h e n   u s e r   m o u s e   d o w n   t h e   b o r d e r   o f   w i n d o w   p a n e l   i f   i t   i s   r e s i z e d .  
 	 	 	 	 	 c o n t a i n e r . r e m o v e C l a s s ( ' n o - r e s i z a b l e ' ) ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   i f (   m a x i m i z e d   )   {   / /   m a x i m i z e d   - >   c a s c a d e  
 	 	 	 	 m a x i m i z e d   =   f a l s e ;  
 	 	 	 	 r p o s   =   p o s ;  
 	 	 	 	 r w h   =   w h ;  
 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' w i n d o w _ h e a d e r _ m a x i m i z e ' ) ;  
 	 	 	 	 h e a d e r . a d d C l a s s ( ' w i n d o w _ h e a d e r _ n o r m a l ' ) ;  
 	 	 	 	 / /   m u s t   a d d   t h i s ,   o r   i t   w i l l   g e t   a   b u g   w h e n   u s e r   m o u s e   d o w n   t h e   b o r d e r   o f   w i n d o w   p a n e l   i f   i t   i s   r e s i z e d .  
 	 	 	 	 c o n t a i n e r . r e m o v e C l a s s ( ' n o - r e s i z a b l e ' ) ;  
 	 	 	 }  
  
 	 	 	 i f (   o p t i o n s . s h o w R o u n d C o r n e r   )   {  
 	 	 	 	 h e a d e r . r e m o v e C l a s s ( ' u i - c o r n e r - a l l ' ) ;  
 	 	 	 	 h e a d e r . a d d C l a s s ( ' u i - c o r n e r - t o p ' ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   u n b i n d   e v e n t  
 	 	 	 c o n t a i n e r . u n b i n d ( " m o u s e o v e r " ) ;  
 	 	 	 c o n t a i n e r . u n b i n d ( " m o u s e o u t " ) ;  
  
 	 	 	 t a r g e t C s s S t y l e   =   {  
 	 	 	 	 l e f t :   r p o s . l e f t ,  
 	 	 	 	 t o p :   r p o s . t o p ,  
 	 	 	 	 w i d t h :   r w h . w ,  
 	 	 	 	 h e i g h t :   r w h . h ,  
 	 	 	 	 o p a c i t y :   1  
 	 	 	 } ;  
 	 	 	  
 	 	 	 h i d e C o n t e n t ( ) ;  
 	 	 	 c o n t a i n e r . a n i m a t e ( t a r g e t C s s S t y l e ,   s e t t i n g . a n i m a t i o n S p e e d ,   ' s w i n g ' ,   f u n c t i o n ( )   {  
 	 	 	 	 c o n t a i n e r . c s s ( ' z - i n d e x ' ,   z I n d e x ) ;  
 	 	 	 	 s h o w C o n t e n t ( ) ;  
 	 	 	 	 h e a d e r . u n b i n d ( ' c l i c k ' ) ;  
 	 	 	 	 a d j u s t H e a d e r T e x t P a n e l W i d t h ( ) ;  
 	 	 	 	 a d j u s t F r a m e W H ( ) ;  
 	  
 	 	 	 	 / /   s w i t c h   m a x i m i z e ,   c a c a d e   i c o n  
 	 	 	 	 i f (   m a x i m i z e d   )   {  
 	 	 	 	 	 i f (   c a l l e r   = =   n u l l   )   {  
 	 	 	 	 	 	 h i d e B r o w s e r S c r o l l b a r ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . m a x i m i z e I m g " ) . h i d e ( ) ;  
 	 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . c a s c a d e I m g " ) . s h o w ( ) ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 s h o w B r o w s e r S c r o l l b a r ( ) ;  
 	 	 	 	 	 c o n t a i n e r . d r a g g a b l e (   ' e n a b l e '   ) ;  
 	 	 	 	 	 c o n t a i n e r . r e s i z a b l e (   ' e n a b l e '   ) ;  
 	 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . m a x i m i z e I m g " ) . s h o w ( ) ;  
 	 	 	 	 	 h e a d e r F u n c P a n e l . c h i l d r e n ( " . c a s c a d e I m g " ) . h i d e ( ) ;  
 	 	 	 	 }  
 	 	 	 	 h e a d e r F u n c P a n e l . s h o w ( ) ;  
 	 	 	 	  
 	 	 	 	 / /   p o p   f r o m   m i n i m i z e d   w i n d o w   s t o r a g e  
 	 	 	 	 i f (   m i n i m i z e d   )   {  
 	 	 	 	 	 m i n i m i z e d   =   f a l s e ;  
 	 	 	 	 	 p o p M i n W i n d o w ( c a l l e r ,   _ t h i s ) ;  
 	 	 	 	 	 c h e c k M i n W i n d o w S i z e ( c a l l e r ,   f a l s e ) ;  
 	 	 	 	 	 a d j u s t A l l M i n W i n d o w s ( c a l l e r ) ;   / /   a d j u s t   m i n i m i z e d   w i n d o w   p o s i t i o n  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 / /   a f t e r   c a l l b a c k  
 	 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . a f t e r C a s c a d e )   )   {  
 	 	 	 	 	 o p t i o n s . a f t e r C a s c a d e ( _ t h i s ) ;  
 	 	 	 	 }  
 	 	 	 } ) ;  
 	 	 	  
 	 	 	 / /   b e f o r e   c a l l b a c k  
 	 	 	 i f (   $ . i s F u n c t i o n ( o p t i o n s . o n C a s c a d e )   )   {  
 	 	 	 	 o p t i o n s . o n C a s c a d e ( _ t h i s ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   c l o s e ( q u i e t )   {  
 	 	 	 / /   d o   c a l l b a c k  
 	 	 	 i f (   ! q u i e t   & &   $ . i s F u n c t i o n ( o p t i o n s . o n C l o s e )   )   {  
 	 	 	 	 o p t i o n s . o n C l o s e ( _ t h i s ) ;  
 	 	 	 }  
 	 	 	 d e s t r o y ( ) ;  
 	 	 }  
 	  
 	 	 f u n c t i o n   d e s t r o y ( )   {  
 	 	 	 r e d i r e c t C h e c k   =   f a l s e ;  
 	 	 	 i f (   m a x i m i z e d   )   {  
 	 	 	 	 s h o w B r o w s e r S c r o l l b a r ( ) ;  
 	 	 	 }  
 	 	 	 p o p W i n d o w ( _ t h i s ) ;  
 	 	 	 c o n t a i n e r . r e m o v e ( ) ;  
 	 	 	 h i d e O v e r l a y ( t r u e ) ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   s h o w ( )   {  
 	 	 	 c o n t a i n e r . s h o w ( ) ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   h i d e ( )   {  
 	 	 	 c o n t a i n e r . h i d e ( ) ;  
 	 	 }  
 	 	  
 	 	 f u n c t i o n   _ d e c r e a s e M i n i I n d e x ( )   {  
 	 	 	 m i n i S t a c k I n d e x - - ;  
 	 	 }  
 	  
 	 	 r e t u r n   {   / /   i n s t a n c e   p u b l i c   m e t h o d s  
 	 	 	 i n i t i a l i z e :   i n i t i a l i z e ,  
 	 	 	 g e t T a r g e t C s s S t y l e :   g e t T a r g e t C s s S t y l e ,                   / /   g e t   t h e   c s s   r e a d y   t o   c h a n g e  
 	 	 	 g e t W i n d o w I d :   f u n c t i o n ( )   {                                           / /   g e t   w i n d o w   i d  
 	 	 	 	 r e t u r n   w i n d o w I d ;  
 	 	 	 } ,  
 	 	 	 g e t C a l l e r :   g e t C a l l e r ,                                                   / /   g e t   w i n d o w   c o n t a i n e r ' s   p a r e n t   p a n e l ,   i t ' s   a   j Q u e r y   o b j e c t  
 	 	 	 g e t C o n t a i n e r :   g e t C o n t a i n e r ,                                       / /   g e t   w i n d o w   c o n t a i n e r   p a n e l ,   i t ' s   a   j Q u e r y   o b j e c t  
 	 	 	 g e t H e a d e r :   g e t H e a d e r ,                                                   / /   g e t   w i n d o w   h e a d e r   p a n e l , i t ' s     a   j Q u e r y   o b j e c t  
 	 	 	 g e t F r a m e :   g e t F r a m e ,                                                       / /   g e t   w i n d o w   f r a m e   p a n e l ,   i t ' s   a   j Q u e r y   o b j e c t  
 	 	 	 g e t F o o t e r :   g e t F o o t e r ,                                                   / /   g e t   w i n d o w   f o o t e r   p a n e l ,   i t ' s   a   j Q u e r y   o b j e c t  
 	 	 	 a l i g n C e n t e r :   a l i g n C e n t e r ,                                           / /   s e t   c u r r e n t   w i n d o w   a s   s c r e e n   c e n t e r  
 	 	 	 a l i g n H o r i z o n t a l C e n t e r :   a l i g n H o r i z o n t a l C e n t e r ,   / /   s e t   c u r r e n t   w i n d o w   a s   h o r i z o n t a l   c e n t e r  
 	 	 	 a l i g n V e r t i c a l C e n t e r :   a l i g n V e r t i c a l C e n t e r ,           / /   s e t   c u r r e n t   w i n d o w   a s   v e r t i c a l   c e n t e r  
 	 	 	 s e l e c t :   s e l e c t ,                                                               / /   s e l e c t   c u r r e n t   w i n d o w ,   i t   w i l l   i n c r e a s e   t h e   o r i g i n a l   z - i n d e x   v a l u e   w i t h   2  
 	 	 	 u n s e l e c t :   u n s e l e c t ,                                                       / /   u n s e l e c t   c u r r e n t   w i n d o w ,   i t   w i l l   s e t   t h e   z - i n d e x   a s   o r i g i n a l   o p t i o n s . z  
 	 	 	 m o v e :   m o v e ,                                                                       / /   m o v e   c u r r e n t   w i n d o w   t o   t a r g e t   p o s i t i o n   o r   s h i f t   i t   b y   p a s s e d   d i s t a n c e  
 	 	 	 r e s i z e :   r e s i z e ,                                                               / /   r e s i z e   c u r r e n t   w i n d o w   t o   t a r g e t   w i d t h / h e i g h t  
 	 	 	 m a x i m i z e :   m a x i m i z e ,                                                       / /   m a x i m i z e   c u r r e n t   w i n d o w  
 	 	 	 m i n i m i z e :   m i n i m i z e ,                                                       / /   m i n i m i z e   c u r r e n t   w i n d o w  
 	 	 	 r e s t o r e :   r e s t o r e ,                                                           / /   r e s t o r e   c u r r e n t   w i n d o w ,   i t   c o u l d   b e   m a x i m i z e d   o r   c a s c a d e   s t a t u s  
 	 	 	 c l o s e :   c l o s e ,                                                                   / /   c l o s e   c u r r e n t   w i n d o w .   p a r a m e t e r :   q u i e t   -   [ b o o l e a n ]   t o   d e c i d e   d o i n g   c a l l b a c k   o r   n o t  
 	 	 	 h i d e :   h i d e ,                                                                       / /   h i d e   c u r r e n t   w i n d o w .  
 	 	 	 s h o w :   s h o w ,                                                                       / /   s h o w   c u r r e n t   w i n d o w .  
 	 	 	 s e t T i t l e :   s e t T i t l e ,                                                       / /   c h a n g e   w i n d o w   t i t l e .   p a r a m e t e r :   t i t l e   -   [ s t r i n g ]   w i n d o w   t i t l e   t e x t  
 	 	 	 s e t U r l :   s e t U r l ,                                                               / /   c h a n g e   i f r a m e   u r l .   p a r a m e t e r :   u r l   -   [ s t r i n g ]   i f r a m e   u r l  
 	 	 	 s e t C o n t e n t :   s e t C o n t e n t ,                                               / /   c h a n g e   f r a m e   c o n t e n t .   p a r a m e t e r :   c o n t e n t   -   [ h t m l   s t r i n g ,   j q u e r y   o b j e c t ,   e l e m e n t ]   t h e   c o n t e n t   o f   f r a m e  
 	 	 	 s e t F o o t e r C o n t e n t :   s e t F o o t e r C o n t e n t ,                       / /   c h a n g e   f o o t e r   c o n t e n t .   p a r a m e t e r :   c o n t e n t   -   [ h t m l   s t r i n g ,   j q u e r y   o b j e c t ,   e l e m e n t ]   t h e   c o n t e n t   o f   f o o t e r  
 	 	 	 g e t T i t l e :   g e t T i t l e ,                                                       / /   g e t   w i n d o w   t i t l e   t e x t  
 	 	 	 g e t U r l :   g e t U r l ,                                                               / /   g e t   u r l   s t r i n g  
 	 	 	 g e t C o n t e n t :   g e t C o n t e n t ,                                               / /   g e t   f r a m e   h t m l   c o n t e n t  
 	 	 	 g e t F o o t e r C o n t e n t :   g e t F o o t e r C o n t e n t ,                       / /   g e t   f o o t e r   h t m l   c o n t e n t  
 	 	 	 i s M a x i m i z e d :   f u n c t i o n ( )   {                                           / /   g e t   w i n d o w   m a x i m i z e d   s t a t u s  
 	 	 	 	 r e t u r n   m a x i m i z e d ;  
 	 	 	 } ,  
 	 	 	 i s M i n i m i z e d :   f u n c t i o n ( )   {                                           / /   g e t   w i n d o w   m i n m i z e d   s t a t u s  
 	 	 	 	 r e t u r n   m i n i m i z e d ;  
 	 	 	 } ,  
 	 	 	 i s S e l e c t e d :   f u n c t i o n ( )   {                                             / /   g e t   w i n d o w   s e l e c t e d   s t a t u s  
 	 	 	 	 r e t u r n   s e l e c t e d ;  
 	 	 	 } ,  
 	 	 	 s e t I c o n :   s e t I c o n ,                                                           / /   s e t   w i n d o w   i c o n  
 	 	 	 s h o w I c o n :   s h o w I c o n ,                                                       / /   s h o w   w i n d o w   i c o n  
 	 	 	 h i d e I c o n :   h i d e I c o n ,                                                       / /   h i d e   w i n d o w   i c o n  
 	 	 	  
 	 	 	 / /   f o r   p l u g i n   p r i v a t e   u s e  
 	 	 	 _ d e c r e a s e M i n i I n d e x :   _ d e c r e a s e M i n i I n d e x ,  
 	 	 	 _ a d j u s t M i n i m i z e d P o s :   _ a d j u s t M i n i m i z e d P o s ,  
 	 	 	 _ s e t O r g W H :   f u n c t i o n ( w h )   {  
 	 	 	 	 o r g W h . w   =   w h . w i d t h ;  
 	 	 	 	 o r g W h . h   =   w h . h e i g h t ;  
 	 	 	 } ,  
 	 	 	 _ t r a n s f o r m T i t l e T e x t :   _ t r a n s f o r m T i t l e T e x t ,  
 	 	 	 t o S t r i n g :   f u n c t i o n ( )   {  
 	 	 	 	 r e t u r n   ' [ W i n d o w ]   i d = ' + w i n d o w I d + ' ,   t i t l e = ' + o p t i o n s . t i t l e ;  
 	 	 	 }  
 	 	 } ;  
 	 }   / /   c o n s t r u c t o r   e n d  
 	  
 	 r e t u r n   {   / /   s t a t i c   p u b l i c   m e t h o d s  
 	 	 g e t I n s t a n c e :   f u n c t i o n ( c a l l e r ,   o p t i o n s )   {   / /   c r e a t e   n e w   w i n d o w   i n s t a n c e  
 	 	 	 v a r   i n s t a n c e   =   c o n s t r u c t o r ( c a l l e r ,   o p t i o n s ) ;  
 	 	 	 i n s t a n c e . i n i t i a l i z e ( i n s t a n c e ) ;  
 	 	 	 s e l e c t W i n d o w ( c a l l e r ,   i n s t a n c e ) ;   / /   s e t   n e w   c r e a t e d   w i n d o w   i n s t a n c e   a s   s e l e c t e d  
 	 	 	 p u s h W i n d o w ( i n s t a n c e ) ;  
 	 	 	 i f (   c a l l e r   ! =   n u l l   )   {  
 	 	 	 	 i f (   c a l l e r . g e t ( 0 ) . _ m i n W i n D a t a   = =   n u l l   )   {  
 	 	 	 	 	 / /   c r e a t e   t h e   m i n i m i z e d   w i n d o w   r e l a t i v e   d a t a  
 	 	 	 	 	 c a l l e r . g e t ( 0 ) . _ m i n W i n D a t a   =   {  
 	 	 	 	 	 	 l o n g :   s e t t i n g . m i n W i n L o n g ,  
 	 	 	 	 	 	 s t o r a g e :   [ ]  
 	 	 	 	 	 } ;  
 	 	 	 	 }  
 	 	 	 	 p a r e n t C a l l e r s . p u s h ( c a l l e r ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   s t a t i c   i n i t i a l z a t i o n  
 	 	 	 i f (   ! i n i t i a l i z e d   )   {  
 	 	 	 	 / /   h a n d l e   w i n d o w   r e s i z e   e v e n t  
 	 	 	 	 $ ( w i n d o w ) . r e s i z e ( f u n c t i o n ( )   {  
 	 	 	 	 	 i f (   r e s i z e T i m e r   ! =   n u l l   )   {  
 	 	 	 	 	 	 c l e a r T i m e o u t ( r e s i z e T i m e r ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 r e s i z e T i m e r   =   w i n d o w . s e t T i m e o u t ( f u n c t i o n ( )   {  
 	 	 	 	 	 	 v a r   s c r e e n W H   =   g e t B r o w s e r S c r e e n W H ( ) ;  
 	 	 	 	 	 	 f o r (   v a r   i = 0 ,   l e n = w i n d o w S t o r a g e . l e n g t h ;   i < l e n ;   i + +   )   {  
 	 	 	 	 	 	 	 v a r   w n d   =   w i n d o w S t o r a g e [ i ] ;  
 	 	 	 	 	 	 	 i f (   w n d . i s M a x i m i z e d ( )   )   {  
 	 	 	 	 	 	 	 	 i f (   w n d . i s M i n i m i z e d ( )   )   {  
 	 	 	 	 	 	 	 	 	 / /   r e s e t   t h e   r e s t o r e   w i d t h / h e i g h t  
 	 	 	 	 	 	 	 	 	 w n d . _ s e t O r g W H ( s c r e e n W H ) ;  
 	 	 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 	 	 w n d . m a x i m i z e ( t r u e ,   t r u e ) ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	  
 	 	 	 	 	 	 	 i f (   w n d . i s M i n i m i z e d ( )   )   {  
 	 	 	 	 	 	 	 	 w n d . _ a d j u s t M i n i m i z e d P o s ( t r u e ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } ,   R E S I Z E _ E V E N T _ D E L A Y ) ;  
 	 	 	 	 } ) ;  
 	 	 	 	 i n i t i a l i z e d   =   t r u e ;  
 	 	 	 }  
 	 	 	  
 	 	 	 r e t u r n   i n s t a n c e ;  
 	 	 } ,  
 	 	 g e t V e r s i o n :   f u n c t i o n ( )   {   / /   g e t   c u r r e n t   v e r s i o n   o f   p l u g i n  
 	 	 	 r e t u r n   V E R S I O N ;  
 	 	 } ,  
 	 	 p r e p a r e :   f u n c t i o n ( c u s t S e t t i n g )   {   / /   i n i t i a l i z e   w i t h   c u s t o m e r i z e d   s t a t i c   s e t t i n g   a t t r i b u t e s  
 	 	 	 $ . e x t e n d ( s e t t i n g ,   c u s t S e t t i n g ) ;  
 	 	 	 m i n W i n D a t a . l o n g   =   s e t t i n g . m i n W i n L o n g ;  
 	 	 	  
 	 	 	 / /   c h e c k   d o c k   a r e a   a t t r i b u t e  
 	 	 	 i f (   s e t t i n g . d o c k A r e a   ! =   n u l l   )   {  
 	 	 	 	 v a r   d A r e a   =   $ ( s e t t i n g . d o c k A r e a ) ;  
 	 	 	 	 i f (   d A r e a . g e t ( 0 ) . _ m i n W i n D a t a   = =   n u l l   )   {  
 	 	 	 	 	 / /   c r e a t e   t h e   m i n i m i z e d   w i n d o w   r e l a t i v e   d a t a  
 	 	 	 	 	 d A r e a . g e t ( 0 ) . _ m i n W i n D a t a   =   {  
 	 	 	 	 	 	 l o n g :   s e t t i n g . m i n W i n L o n g ,  
 	 	 	 	 	 	 s t o r a g e :   [ ]  
 	 	 	 	 	 } ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 } ,  
 	 	 c l o s e A l l :   f u n c t i o n ( q u i e t )   {   / /   c l o s e   a l l   c r e a t e d   w i n d o w s .   i t   g o t   a   p a r a m e t e r   -   q u i e t ,   a   b o o l e a n   f l a g   t o   d e c i d e   d o i n g   c a l l b a c k   o r   n o t  
 	 	 	 v a r   c o u n t   =   w i n d o w S t o r a g e . l e n g t h ;  
 	 	 	 f o r (   v a r   i = 0 ;   i < c o u n t ;   i + +   )   {  
 	 	 	 	 v a r   w n d   =   w i n d o w S t o r a g e [ 0 ] ;  
 	 	 	 	 w n d . c l o s e ( q u i e t ) ;  
 	 	 	 }  
 	 	 	 w i n d o w S t o r a g e   =   [ ] ;  
 	 	 	 / /   r e s e t   m i n i m i z e d   w i n d o w   d a t a   o b j e c t  
 	 	 	 m i n W i n D a t a . s t o r a g e   =   [ ] ;  
 	 	 	 m i n W i n D a t a . l o n g   =   s e t t i n g . m i n W i n L o n g ;  
 	 	 	 f o r (   v a r   i = 0 ;   i < p a r e n t C a l l e r s . l e n g t h ;   i + +   )   {  
 	 	 	 	 v a r   m w d a t a   =   p a r e n t C a l l e r s [ i ] . g e t ( 0 ) . _ m i n W i n D a t a ;  
 	 	 	 	 m w d a t a . s t o r a g e   =   [ ] ;  
 	 	 	 	 m w d a t a . l o n g   =   s e t t i n g . m i n W i n L o n g ;  
 	 	 	 }  
 	 	 } ,  
 	 	 h i d e A l l :   f u n c t i o n ( )   {   / /   h i d e   a l l   c r e a t e d   w i n d o w s  
 	 	 	 f o r (   v a r   i = 0 ,   l e n = w i n d o w S t o r a g e . l e n g t h ;   i < l e n ;   i + +   )   {  
 	 	 	 	 w i n d o w S t o r a g e [ i ] . g e t C o n t a i n e r ( ) . h i d e ( ) ;  
 	 	 	 }  
 	 	 } ,  
 	 	 s h o w A l l :   f u n c t i o n ( )   {   / /   s h o w   a l l   c r e a t e d   w i n d o w s  
 	 	 	 f o r (   v a r   i = 0 ,   l e n = w i n d o w S t o r a g e . l e n g t h ;   i < l e n ;   i + +   )   {  
 	 	 	 	 w i n d o w S t o r a g e [ i ] . g e t C o n t a i n e r ( ) . s h o w ( ) ;  
 	 	 	 }  
 	 	 } ,  
 	 	 g e t A l l :   f u n c t i o n ( )   {   / /   r e t u r n   a l l   c r e a t e d   w i n d o w s   i n s t a n c e  
 	 	 	 r e t u r n   w i n d o w S t o r a g e ;  
 	 	 } ,  
 	 	 g e t W i n d o w :   g e t W i n d o w ,   / /   g e t   t h e   w i n d o w   i n s t a n c e   b y   p a s s e d   w i n d o w   i d  
 	 	 g e t S e l e c t e d W i n d o w :   f u n c t i o n ( )   {   / /   g e t   t h e   s e l e c t e d   w i n d o w   i n s t a n c e  
 	 	 	 f o r (   v a r   i = 0 ,   l e n = w i n d o w S t o r a g e . l e n g t h ;   i < l e n ;   i + +   )   {  
 	 	 	 	 v a r   w n d   =   w i n d o w S t o r a g e [ i ] ;  
 	 	 	 	 i f (   w n d . i s S e l e c t e d ( )   )   {  
 	 	 	 	 	 r e t u r n   w n d ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 } ,  
 	 	 _ i c o n O n L o a d :   f u n c t i o n ( e l e m e n t )   {  
 	 	 	 v a r   w i n d o w I d   =   $ ( e l e m e n t ) . p a r e n t ( ) . p a r e n t ( ) . a t t r ( ' i d ' ) ;  
 	 	 	 l o g ( ' _ i c o n O n L o a d :   ' + w i n d o w I d ) ;  
 	 	 	 i f (   w i n d o w I d   ! =   n u l l   )   {  
 	 	 	 	 v a r   w n d   =   $ . W i n d o w . g e t W i n d o w ( w i n d o w I d ) ;  
 	 	 	 	 i f (   w n d   ! =   n u l l   )   {  
 	 	 	 	 	 w n d . s h o w I c o n ( ) ;  
 	 	 	 	 }  
 	 	 	 }   e l s e   {  
 	 	 	 	 w a r n ( ' [ _ i c o n O n L o a d ]   l o s t   w i n d o w   i d ! ! ! ' ) ;  
 	 	 	 }  
 	 	 }  
 	 }  
 } ) ( ) ;  
  
 / /   a l i a s   m e t h o d s  
 $ . w i n d o w . g e t V e r s i o n   =   $ . W i n d o w . g e t V e r s i o n ;  
 $ . w i n d o w . p r e p a r e   =   $ . W i n d o w . p r e p a r e ;  
 $ . w i n d o w . c l o s e A l l   =   $ . W i n d o w . c l o s e A l l ;  
 $ . w i n d o w . h i d e A l l   =   $ . W i n d o w . h i d e A l l ;  
 $ . w i n d o w . s h o w A l l   =   $ . W i n d o w . s h o w A l l ;  
 $ . w i n d o w . g e t A l l   =   $ . W i n d o w . g e t A l l ;  
 $ . w i n d o w . g e t W i n d o w   =   $ . W i n d o w . g e t W i n d o w ;  
 $ . w i n d o w . g e t S e l e c t e d W i n d o w   =   $ . W i n d o w . g e t S e l e c t e d W i n d o w ; 
