ÿþ/ /   j Q u e r y   A l e r t   D i a l o g s   P l u g i n  
 ( f u n c t i o n ( $ )   {  
  
         / / / a d d   b y :   h c u b i u  
         / / / s h o w   p o p u p   t r u y e n   t h e m   i d   c u a   b o x   v a o  
         $ . a l e r t s 1   =   {  
  
                 v e r t i c a l O f f s e t :   - 7 5 ,                                 / /   v e r t i c a l   o f f s e t   o f   t h e   d i a l o g   f r o m   c e n t e r   s c r e e n ,   i n   p i x e l s  
                 h o r i z o n t a l O f f s e t :   0 ,                                 / /   h o r i z o n t a l   o f f s e t   o f   t h e   d i a l o g   f r o m   c e n t e r   s c r e e n ,   i n   p i x e l s /  
                 r e p o s i t i o n O n R e s i z e :   t r u e ,                       / /   r e - c e n t e r s   t h e   d i a l o g   o n   w i n d o w   r e s i z e  
                 o v e r l a y O p a c i t y :   . 8 ,                                 / /   t r a n s p a r e n c y   l e v e l   o f   o v e r l a y  
                 o v e r l a y C o l o r :   ' # 0 0 0 0 0 0 ' ,                               / /   b a s e   c o l o r   o f   o v e r l a y  
                 d r a g g a b l e :   t r u e ,                                         / /   m a k e   t h e   d i a l o g s   d r a g g a b l e   ( r e q u i r e s   U I   D r a g g a b l e s   p l u g i n )  
                 o k B u t t o n :   ' & n b s p ; Ón g   ý & n b s p ; ' ,                   / /   t e x t   f o r   t h e   O K   b u t t o n  
                 c a n c e l B u t t o n :   ' & n b s p ; ó n g   l ¡i & n b s p ; ' ,   / /   t e x t   f o r   t h e   C a n c e l   b u t t o n  
                 d i a l o g C l a s s :   n u l l ,                                     / /   i f   s p e c i f i e d ,   t h i s   c l a s s   w i l l   b e   a p p l i e d   t o   a l l   d i a l o g s  
                 i n p u t w i d t h :   5 0 0 ,  
  
                 / /   P u b l i c   m e t h o d s  
                 a l e r t :   f u n c t i o n ( m e s s a g e ,   t i t l e ,   x w i d t h ,   i d ,   c a l l b a c k )   {  
                         i f   ( t i t l e   = =   n u l l )   t i t l e   =   ' A l e r t ' ;  
                         i f   ( x w i d t h   ! =   n u l l )   $ . a l e r t s . i n p u t w i d t h   =   x w i d t h ;  
                         $ . a l e r t s 1 . _ s h o w ( t i t l e ,   m e s s a g e ,   n u l l ,   ' a l e r t ' ,   i d ,   f u n c t i o n ( r e s u l t )   {  
                                 i f   ( c a l l b a c k )   c a l l b a c k ( r e s u l t ) ;  
                         } ) ;  
                 } ,  
  
                 c o n f i r m :   f u n c t i o n ( m e s s a g e ,   t i t l e ,   i d ,   c a l l b a c k )   {  
                         i f   ( t i t l e   = =   n u l l )   t i t l e   =   ' C o n f i r m ' ;  
                         $ . a l e r t s 1 . _ s h o w ( t i t l e ,   m e s s a g e ,   n u l l ,   ' c o n f i r m ' ,   i d ,   f u n c t i o n ( r e s u l t )   {  
                                 i f   ( c a l l b a c k )   c a l l b a c k ( r e s u l t ) ;  
                         } ) ;  
                 } ,  
  
                 / /   P r i v a t e   m e t h o d s  
                 _ s h o w :   f u n c t i o n ( t i t l e ,   m s g ,   v a l u e ,   t y p e ,   i d ,   c a l l b a c k )   {  
  
                         $ . a l e r t s 1 . _ h i d e ( i d ) ;  
  
                         $ ( " B O D Y " ) . a p p e n d (  
 	 	 	     ' < d i v   c l a s s = " p o p u p _ c o n t a i n e r "   i d = " p o p u p _ c o n t a i n e r '   +   i d   +   ' " > '   +  
 	 	 	         ' < h 1   c l a s s = " p o p u p _ t i t l e "   i d = " p o p u p _ t i t l e '   +   i d   +   ' " > < / h 1 > '   +  
 	 	 	         ' < d i v   c l a s s = " p o p u p _ c o n t e n t "   i d = " p o p u p _ c o n t e n t '   +   i d   +   ' " > '   +  
 	 	 	             ' < d i v   c l a s s = " p o p u p _ m e s s a g e "   i d = " p o p u p _ m e s s a g e '   +   i d   +   ' " > < / d i v > '   +  
 	 	 	 	 ' < / d i v > '   +  
 	 	 	     ' < / d i v > ' ) ;  
  
                         i f   ( $ . a l e r t s 1 . d i a l o g C l a s s )   $ ( " # p o p u p _ c o n t a i n e r "   +   i d ) . a d d C l a s s ( $ . a l e r t s 1 . d i a l o g C l a s s ) ;  
  
                         / /   I E 6   F i x  
                         v a r   p o s   =   ( $ . b r o w s e r . m s i e   & &   p a r s e I n t ( $ . b r o w s e r . v e r s i o n )   < =   6 )   ?   ' a b s o l u t e '   :   ' f i x e d ' ;  
  
                         $ ( " # p o p u p _ c o n t a i n e r "   +   i d ) . c s s ( {  
                                 p o s i t i o n :   p o s ,  
                                 z I n d e x :   9 9 9 9 9 ,  
                                 p a d d i n g :   0 ,  
                                 m a r g i n :   0  
                         } ) ;  
  
                         $ ( " # p o p u p _ t i t l e "   +   i d ) . t e x t ( t i t l e ) ;  
                         $ ( " # p o p u p _ c o n t e n t "   +   i d ) . a d d C l a s s ( t y p e ) ;  
                         $ ( " # p o p u p _ m e s s a g e "   +   i d ) . t e x t ( m s g ) ;  
                         $ ( " # p o p u p _ m e s s a g e "   +   i d ) . h t m l ( $ ( " # p o p u p _ m e s s a g e "   +   i d ) . t e x t ( ) . r e p l a c e ( / \ n / g ,   ' < b r   / > ' ) ) ;  
  
                         $ . a l e r t s 1 . _ r e p o s i t i o n ( i d ) ;  
                         $ . a l e r t s 1 . _ m a i n t a i n P o s i t i o n ( t r u e ) ;  
  
                         s w i t c h   ( t y p e )   {  
                                 c a s e   ' a l e r t ' :  
                                         $ ( " # p o p u p _ m e s s a g e "   +   i d ) . a f t e r ( ' < d i v   c l a s s = " p o p u p _ p a n e l "   i d = " p o p u p _ p a n e l '   +   i d   +   ' " > < i n p u t   t y p e = " b u t t o n "   c l a s s = " p o p u p _ o k "   v a l u e = " '   +   $ . a l e r t s 1 . o k B u t t o n   +   ' "   i d = " p o p u p _ o k '   +   i d   +   ' "   / > < / d i v > ' ) ;  
                                         $ ( " # p o p u p _ o k "   +   i d ) . c l i c k ( f u n c t i o n ( )   {  
                                                 $ . a l e r t s 1 . _ h i d e ( i d ) ;  
                                                 c a l l b a c k ( t r u e ) ;  
                                         } ) ;  
                                         $ ( " # p o p u p _ o k "   +   i d ) . f o c u s ( ) . k e y p r e s s ( f u n c t i o n ( e )   {  
                                                 i f   ( e . k e y C o d e   = =   1 3   | |   e . k e y C o d e   = =   2 7 )   $ ( " # p o p u p _ o k "   +   i d ) . t r i g g e r ( ' c l i c k ' ) ;  
                                         } ) ;  
                                         b r e a k ;  
                                 c a s e   ' c o n f i r m ' :  
                                         $ ( " # p o p u p _ m e s s a g e "   +   i d ) . a f t e r ( ' < d i v   i d = " p o p u p _ p a n e l '   +   i d   +   ' " > < i n p u t   t y p e = " b u t t o n "   v a l u e = " '   +   $ . a l e r t s 1 . c a n c e l B u t t o n   +   ' "   c l a s s = " p o p u p _ c a n c e l "   i d = " p o p u p _ c a n c e l '   +   i d   +   ' "   / > < i n p u t   t y p e = " b u t t o n "   v a l u e = " '   +   $ . a l e r t s 1 . o k B u t t o n   +   ' "   c l a s s = " p o p u p _ o k "   i d = " p o p u p _ o k '   +   i d   +   ' "   / > < / d i v > ' ) ;  
                                         $ ( " # p o p u p _ o k "   +   i d ) . c l i c k ( f u n c t i o n ( )   {  
                                                 $ . a l e r t s 1 . _ h i d e ( i d ) ;  
                                                 i f   ( c a l l b a c k )   c a l l b a c k ( t r u e ) ;  
                                         } ) ;  
                                         $ ( " # p o p u p _ c a n c e l "   +   i d ) . c l i c k ( f u n c t i o n ( )   {  
                                                 $ . a l e r t s 1 . _ h i d e ( i d ) ;  
                                                 i f   ( c a l l b a c k )   c a l l b a c k ( f a l s e ) ;  
                                         } ) ;  
                                         $ ( " # p o p u p _ o k "   +   i d ) . f o c u s ( ) ;  
                                         $ ( " # p o p u p _ o k "   +   i d   +   " ,   # p o p u p _ c a n c e l "   +   i d ) . k e y p r e s s ( f u n c t i o n ( e )   {  
                                                 i f   ( e . k e y C o d e   = =   1 3 )   $ ( " # p o p u p _ o k "   +   i d ) . t r i g g e r ( ' c l i c k ' ) ;  
                                                 i f   ( e . k e y C o d e   = =   2 7 )   $ ( " # p o p u p _ c a n c e l "   +   i d ) . t r i g g e r ( ' c l i c k ' ) ;  
                                         } ) ;  
                                         b r e a k ;  
                         }  
  
                         / /   M a k e   d r a g g a b l e  
                         i f   ( $ . a l e r t s 1 . d r a g g a b l e )   {  
                                 t r y   {  
                                         $ ( " # p o p u p _ c o n t a i n e r "   +   i d ) . d r a g g a b l e ( {   h a n d l e :   $ ( " # p o p u p _ t i t l e "   +   i d )   } ) ;  
                                         $ ( " # p o p u p _ t i t l e "   +   i d ) . c s s ( {   c u r s o r :   ' m o v e '   } ) ;  
                                 }   c a t c h   ( e )   {   / *   r e q u i r e s   j Q u e r y   U I   d r a g g a b l e s   * /   }  
                         }  
                 } ,  
  
                 _ h i d e :   f u n c t i o n ( i d )   {  
                         $ ( " # p o p u p _ c o n t a i n e r "   +   i d ) . r e m o v e ( ) ;  
                         $ . a l e r t s 1 . _ m a i n t a i n P o s i t i o n ( f a l s e ) ;  
                 } ,  
  
                 _ r e p o s i t i o n :   f u n c t i o n ( i d )   {  
                         v a r   t o p   =   ( ( $ ( w i n d o w ) . h e i g h t ( )   /   2 )   -   ( $ ( " # p o p u p _ c o n t a i n e r "   +   i d ) . o u t e r H e i g h t ( )   /   2 ) )   +   $ . a l e r t s 1 . v e r t i c a l O f f s e t ;  
                         v a r   l e f t   =   ( ( $ ( w i n d o w ) . w i d t h ( )   -   $ . a l e r t s 1 . i n p u t w i d t h )   /   2 ) ;  
                         i f   ( t o p   <   0 )   t o p   =   0 ;  
                         i f   ( l e f t   <   0 )   l e f t   =   0 ;  
  
                         / /   I E 6   f i x  
                         i f   ( $ . b r o w s e r . m s i e   & &   p a r s e I n t ( $ . b r o w s e r . v e r s i o n )   < =   6 )   t o p   =   t o p   +   $ ( w i n d o w ) . s c r o l l T o p ( ) ;  
  
                         $ ( " # p o p u p _ c o n t a i n e r "   +   i d ) . c s s ( {  
                                 t o p :   t o p   +   ' p x ' ,  
                                 l e f t :   l e f t   +   ' p x '  
                         } ) ;  
                 } ,  
  
                 _ m a i n t a i n P o s i t i o n :   f u n c t i o n ( s t a t u s )   {  
                         i f   ( $ . a l e r t s 1 . r e p o s i t i o n O n R e s i z e )   {  
                                 s w i t c h   ( s t a t u s )   {  
                                         c a s e   t r u e :  
                                                 $ ( w i n d o w ) . b i n d ( ' r e s i z e ' ,   $ . a l e r t s 1 . _ r e p o s i t i o n ) ;  
                                                 b r e a k ;  
                                         c a s e   f a l s e :  
                                                 $ ( w i n d o w ) . u n b i n d ( ' r e s i z e ' ,   $ . a l e r t s 1 . _ r e p o s i t i o n ) ;  
                                                 b r e a k ;  
                                 }  
                         }  
                 }  
  
         }  
  
         j A l e r t 1   =   f u n c t i o n ( m e s s a g e ,   t i t l e ,   i d ,   x w i d t h ,   c a l l b a c k )   {  
                 $ . a l e r t s 1 . a l e r t ( m e s s a g e ,   t i t l e ,   x w i d t h ,   i d ,   c a l l b a c k ) ;  
         }  
  
         j C o n f i r m 1   =   f u n c t i o n ( m e s s a g e ,   t i t l e ,   i d ,   c a l l b a c k )   {  
                 $ . a l e r t s 1 . c o n f i r m ( m e s s a g e ,   t i t l e ,   i d ,   c a l l b a c k ) ;  
         } ;  
  
 } ) ( j Q u e r y ) ; 
