ÿþ/ *   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   \  
 / /   P a c k a g e :   M i h a l i s m   M u l t i   H o s t  
 / /   V e r s i o n :   5 . 0 . 0  
 / /   C o p y r i g h t   ( c )   2 0 0 7 ,   2 0 0 8 ,   2 0 0 9   M i h a l i s m   T e c h n o l o g i e s  
 / /   L i c e n s e :   h t t p : / / w w w . g n u . o r g / l i c e n s e s / g p l . t x t   G N U   P u b l i c   L i c e n s e  
 / /   L T E :   1 2 5 1 4 8 4 1 7 4   -   F r i d a y ,   A u g u s t   2 8 ,   2 0 0 9 ,   0 2 : 2 9 : 3 4   P M   E D T   - 0 4 0 0  
 / /   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   * /  
  
 v a r   l a n g   =   n e w   A r r a y ( ) ;  
 v a r   p a g e _ u r l   =   l o c a t i o n . h r e f ;  
 v a r   i n d e x _ a m f _ m a x   =   1 5 ;  
 v a r   i n d e x _ a m f _ t o t a l     =   0 ;  
 / *   r e C A P T C H A   S e t t i n g s   * /  
 v a r   R e c a p t c h a O p t i o n s   =   {   t h e m e   :   ' w h i t e '   } ;    
  
 / *   L a n g u a g e   S e t t i n g s   * /  
  
 l a n g [ ' 0 0 1 ' ]   =   " C h Ín   v à o   â y   Ã  t h ê m   t i ê u   Á" ;   / /   F i l e   t i t l e   i f   n o   t i t l e   i s   s e t  
 l a n g [ ' 0 0 2 ' ]   =   " H çy " ;   / /   N o t i c e   t o   b e   u s e d   t o   r e m o v e   a   i m a g e   u p l o a d   f i e l d  
 l a n g [ ' 0 0 3 ' ]   =   " M ×i   l §n   u p l o a d   c h É  °ãc   u p l o a d   t Ñi   a   1 5   h ì n h   £n h . " ;   / /   E r r o r   t o   b e   d i s p l a y e d   i f   t o o   m a n y   n e w   i m a g e   u p l o a d   f i e l d s   a r e   a d d e d  
 l a n g [ ' 0 0 4 ' ]   =   " U R L : " ;   / /   N o t i c e   t o   b e   u s e d   t o   i n d i c a t e   a   i m a g e   u p l o a d   f i e l d   i s   f o r   a n   U R L  
 l a n g [ ' 0 0 5 ' ]   =   " X i n   h ã y   c h Ín   í t   n h ¥t   m Ùt   h ì n h   £n h . " ;   / /   E r r o r   t o   b e   d i s p l a y e d   i f   n o   i m a g e s   a r e   s e l e c t e d   t o   d e l e t e   o r   m o v e   o n   b u t t o n   p r e s s  
 l a n g [ ' 0 0 6 ' ]   =   " K i Ãm   t r a   l ¡i " ;   / /   N o t i c e   t o   b e   u s e d   w h e n   t o   r e c h e c k   u s e r n a m e   a v a i l a b l i t y    
 l a n g [ ' 0 0 7 ' ]   =   " T ê n   n g   n h ­p   ã   t Ón   t ¡i -   B ¡n   v u i   l ò n g   c h Ín   t ê n   k h á c " ;   / /   N o t i c e   t o   b e   u s e d   w h e n   a n   u s e r n a m e   i s   n o t   a v a i l a b l e  
 l a n g [ ' 0 0 8 ' ]   =   " T ê n   a n g   n h ­p   h ãp   l Ç  -   B ¡n   c ó   t h Ã  s í  d ån g   t ê n   n à y " ;   / /   N o t i c e   t o   b e   u s e d   w h e n   a n   u s e r n a m e   i s   a v a i l a b l e  
  
 / *   D O   N O T   E D I T   P A S T   T H I S   L I N E   U N L E S S   Y O U   K N O W   W H A T   Y O U   A R E   D O I N G   * /  
  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / s i t e _ l o g o . p n g " ,   9 7 0 ,   1 4 0 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / m a i n _ b g . p n g " ,   1 2 0 ,   4 5 0 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / b l u e _ b o x _ b g . g i f " ,   1 2 ,   1 1 0 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / i n p u t _ b g . g i f " ,   3 0 ,   2 5 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / n a v _ m e m _ b a r . g i f " ,   1 ,   3 0 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / p c _ f o o t _ b g . g i f " ,   6 ,   2 5 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / p r o g r e s s _ b a r . g i f " ,   3 2 ,   3 2 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / t b l _ f o o t _ b g . g i f " ,   8 ,   3 8 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / t b l _ t o p _ b g . g i f " ,   8 ,   2 5 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / b x l a y o u t _ p r e v . p n g " ,   5 0 0 ,   4 6 2 ) ;  
 p r e l o a d _ i m a g e ( " c s s / i m a g e s / s t d l a y o u t _ p r e v . p n g " ,   5 0 0 ,   2 8 3 ) ;  
  
 f u n c t i o n   p r e l o a d _ i m a g e ( p a t h ,   w i d t h ,   h e i g h t )    
 {  
 	 i f   ( d o c u m e n t . i m a g e s )   {  
 	 	 i m a g e _ f i l e   =   n e w   I m a g e ( w i d t h ,   h e i g h t ) ;    
 	 	 i m a g e _ f i l e . s r c   =   p a t h ;  
 	 }  
 }  
  
 f u n c t i o n   g o o g l e _ s t a t s ( i d )  
 {  
 	 v a r   g a J s H o s t   =   ( ( " h t t p s : "   = =   d o c u m e n t . l o c a t i o n . p r o t o c o l )   ?   " h t t p s : / / s s l . "   :   " h t t p : / / w w w . " ) ;  
 	 d o c u m e n t . w r i t e ( u n e s c a p e ( " % 3 C s c r i p t   s r c = ' "   +   g a J s H o s t   +   " g o o g l e - a n a l y t i c s . c o m / g a . j s '   t y p e = ' t e x t / j a v a s c r i p t ' % 3 E % 3 C / s c r i p t % 3 E " ) ) ;  
 	 t r y   {  
 	 	 v a r   p a g e T r a c k e r   =   _ g a t . _ g e t T r a c k e r ( i d ) ;  
 	 	 p a g e T r a c k e r . _ t r a c k P a g e v i e w ( ) ;  
 	 }   c a t c h ( e r r )   { } 	  
 }  
  
 f u n c t i o n   g e t _ a j a x _ c o n t e n t ( t h e u r l )    
 {  
 	 r e t u r n   $ . a j a x ( {  
     	 	 u r l :   t h e u r l ,  
 	 	 a s y n c :   f a l s e ,  
 	 	 t y p e :   " G E T "  
 	 } ) . r e s p o n s e T e x t ;  
 }  
  
 f u n c t i o n   g a l l e r y _ a c t i o n ( a c t ,   i d ,   v a l u e )  
 { 	  
 	 s w i t c h   ( a c t )   {  
 	 	 c a s e   " s e l e c t " :  
 	 	 	 $ ( " i n p u t [ n a m e = u s e r f i l e ] " ) . e a c h ( f u n c t i o n ( )  
 	 	 	 {  
 	 	 	 	 t h i s . c h e c k e d   =   ( ( t h i s . c h e c k e d   = =   1 )   ?   0   :   1 ) ;  
 	 	 	 } ) ;              
 	 	 	 b r e a k ;  
 	 	 c a s e   " r e n a m e " :  
 	 	 	 v a r   c u r r e n t _ t i t l e   =   $ ( " s p a n [ i d = "   +   i d   +   " ] " ) . h t m l ( ) ;  
 	 	 	 $ ( " s p a n [ i d = "   +   i d   +   " ] " ) . t o g g l e ( ) ;  
 	 	 	 $ ( " i n p u t [ i d = "   +   i d   +   " _ r e n a m e ] " ) . t o g g l e ( ) ;  
 	 	 	 $ ( " i n p u t [ i d = "   +   i d   +   " _ r e n a m e ] " ) . v a l ( c u r r e n t _ t i t l e ) ;  
 	 	 	 $ ( " i n p u t [ i d = "   +   i d   +   " _ r e n a m e ] " ) . f o c u s ( ) ;  
 	 	 	 $ ( " i n p u t [ i d = "   +   i d   +   " _ r e n a m e ] " ) . s e l e c t ( ) ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   " r e n a m e - d " :  
 	 	 	 v a r   t h e _ t i t l e   =   $ ( " i n p u t [ i d = "   +   v a l u e   +   " _ t i t l e _ r e n a m e ] " ) . v a l ( ) ;  
 	 	 	 v a r   n e w _ t i t l e   =   ( ( t h e _ t i t l e   = =   " " )   ?   l a n g [ ' 0 0 1 ' ]   :   t h e _ t i t l e ) ;  
 	 	 	 v a r   d a t a   =   g e t _ a j a x _ c o n t e n t ( " u s e r s . p h p ? a c t = r e n a m e _ f i l e _ t i t l e & f i l e = "   +   i d   +   " & t i t l e = "   +   e n c o d e U R I ( n e w _ t i t l e ) ) ;  
 	 	 	 / *   T h e   j Q u e r y   t o g g l e ( )   m e t h o d   i s   n o t   u s e d   t o   f i x   a   k n o w n   b u g .   * /  
 	 	 	 $ ( " i n p u t [ i d = "   +   v a l u e   +   " _ t i t l e _ r e n a m e ] " ) . a t t r ( " s t y l e " ,   " d i s p l a y :   n o n e ; " ) ;  
 	 	 	 $ ( " s p a n [ i d = "   +   v a l u e   +   " _ t i t l e ] " ) . a t t r ( " s t y l e " ,   " d i s p l a y :   i n l i n e ; " ) ;  
 	 	 	 $ ( " s p a n [ i d = "   +   v a l u e   +   " _ t i t l e ] " ) . h t m l ( d a t a ) ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   " m o v e " :  
 	 	 c a s e   " d e l e t e " :  
 	 	 	 v a r   c h e c k e d f i l e s   =   " " ;  
 	 	 	 $ ( " i n p u t [ n a m e = u s e r f i l e ] " ) . e a c h ( f u n c t i o n ( )  
 	 	 	 {  
 	 	 	 	 i f   ( t h i s . c h e c k e d   = =   1 )   {  
 	 	 	 	 	 c h e c k e d f i l e s   + =   ( t h i s . v a l u e   +   " , " ) ;  
 	 	 	 	 }  
 	 	 	 } ) ;              
 	 	 	 i f   ( c h e c k e d f i l e s   ! = =   " " )   {  
 	 	 	 	 c h e c k e d f i l e s   =   c h e c k e d f i l e s . s u b s t r ( 0 ,   ( c h e c k e d f i l e s . l e n g t h   -   1 ) ) ;  
 	 	 	 	 t o g g l e _ l i g h t b o x ( " u s e r s . p h p ? a c t = "   +   a c t   +   " _ f i l e s & f i l e s = "   +   e n c o d e U R I ( c h e c k e d f i l e s )   +   " & r e t u r n = "   +   e n c o d e U R I C o m p o n e n t ( p a g e _ u r l ) ,   ( a c t   +   " _ f i l e s _ l i g h t b o x " ) ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 a l e r t ( l a n g [ ' 0 0 5 ' ] ) ;  
 	 	 	 }  
 	 	 	 b r e a k ;  
 	 }  
 	 r e t u r n ;  
 }  
  
 f u n c t i o n   c e n t e r _ s c r e e n ( i d )  
 {  
 	 / /   L o t s   o f   v a r i a b l e s  
 	 v a r   e l e m w i d t h   =   $ ( i d ) . w i d t h ( ) ;  
         v a r   e l e m h e i g h t   =   $ ( i d ) . h e i g h t ( ) ;  
         v a r   w i n d o w w i d t h   =   $ ( w i n d o w ) . w i d t h ( ) ;  
         v a r   w i n d o w h e i g h t   =   $ ( w i n d o w ) . h e i g h t ( ) ;  
 	 v a r   p r e c e n t u s e   =   ( ( e l e m h e i g h t   /   w i n d o w h e i g h t   )   *   1 0 0 ) ;  
       	 v a r   t h e h e i g h t   =   ( ( w i n d o w h e i g h t   -   e l e m h e i g h t )   /   2 )   -   ( ( p r e c e n t u s e   >   5 0 )   ?   2 . 5   :   5 0 ) ;  
         v a r   t h e w i d t h   =   ( ( w i n d o w w i d t h   -   e l e m w i d t h )   /   2 ) ;  
         v a r   f i n a l h e i g h t   =   ( ( ( ( t h e h e i g h t   <   1 )   ?   0   :   t h e h e i g h t )   +   $ ( w i n d o w ) . s c r o l l T o p ( ) )   +   " p x " ) ;  
         v a r   f i n a l w i d t h   =   ( ( ( t h e w i d t h   <   1 )   ?   0   :   t h e w i d t h )   +   " p x " ) ;  
         r e t u r n   ( " t o p :   "   +   f i n a l h e i g h t   +   " ;   l e f t :   "   +   f i n a l w i d t h   +   " ; " ) ;  
 }  
  
 f u n c t i o n   t o g g l e _ l i g h t b o x ( u r l ,   d i v )  
 {  
 	  
 	 i f   ( u r l   ! = =   " n o _ u r l "   & &   u r l   ! =   " d e f a u l t . p h p ? p a r a m = u p l o a d _ i n _ p r o g r e s s " )   {  
 	 	  
 	 	 / / s c r o l l ( 0 ,   0 ) ;  
 	 	 $ ( " # p a g e _ b o d y " ) . a p p e n d ( " < d i v   i d = \ " "   +   d i v   +   " \ " > < / d i v > " ) ;  
 	 	 v a r   d a t a   =   g e t _ a j a x _ c o n t e n t ( ( u r l   +   ( ( ( u r l . m a t c h ( / \ ? / ) )   ?   " & "   :   " ? " )   +   " l b _ d i v = "   +   d i v   +   " & r e t u r n = "   +   b a s e 6 4 _ e n c o d e ( p a g e _ u r l ) ) ) ) ;  
 	 	 $ ( " d i v [ i d = "   +   d i v   +   " ] " ) . h t m l ( " < d i v   c l a s s = \ " l i g h t b o x _ m a i n \ " > "   +   d a t a   +   " < / d i v > "   +   " < d i v   c l a s s = \ " l i g h t b o x _ b a c k g r o u n d \ " > & n b s p ; < / d i v > " ) ;  
 	 	 $ ( " d i v [ c l a s s = l i g h t b o x _ m a i n ] " ) . a t t r ( " s t y l e " ,   c e n t e r _ s c r e e n ( " d i v [ c l a s s = l i g h t b o x _ m a i n ] " ) ) ;  
 	 	 $ ( " d i v [ c l a s s = l i g h t b o x _ b a c k g r o u n d ] " ) . c s s ( " w i d t h " ,   $ ( d o c u m e n t ) . w i d t h ( ) ) ;  
 	 	 $ ( " d i v [ c l a s s = l i g h t b o x _ b a c k g r o u n d ] " ) . c s s ( " h e i g h t " ,   $ ( d o c u m e n t ) . h e i g h t ( ) ) ;  
 	  
 	 }   e l s e   {  
 	 	 $ ( " d i v [ i d = "   +   d i v   +   " ] " ) . r e m o v e ( ) ;  
 	 }  
 	 r e t u r n ;  
 }  
  
 f u n c t i o n   c h e c k _ u s e r n a m e ( )  
 {  
 	 v a r   u s e r n a m e   =   $ ( " # u s e r n a m e _ f i e l d " ) . v a l ( ) ;          
 	 v a r   d a t a   =   g e t _ a j a x _ c o n t e n t ( " u s e r s . p h p ? a c t = c h e c k _ u s e r n a m e & u s e r n a m e = "   +   e n c o d e U R I ( u s e r n a m e ) ) ;  
 	 i f   ( d a t a   = =   " 1 "   | |   u s e r n a m e   = =   " " )   {  
 	 	 $ ( " # u s e r n a m e _ c h e c k " ) . h t m l ( " < i m g   s r c = \ " c s s / i m a g e s / x e d _ o u t . g i f \ "   a l t = \ " "   +   l a n g [ ' 0 0 7 ' ]   +   " \ "   s t y l e = \ " v e r t i c a l - a l i g n :   - 2 0 % ; \ "   / >   < s p a n   s t y l e = \ " c o l o r :   # C 3 3 ; \ " > "   +   l a n g [ ' 0 0 7 ' ]   +   " < / s p a n >   -   < a   h r e f = \ " j a v a s c r i p t : v o i d ( 0 ) \ "   o n c l i c k = \ " c h e c k _ u s e r n a m e ( ) ; \ " > "   +   l a n g [ ' 0 0 6 ' ]   +   " < / a > " ) ;  
 	 }   e l s e   {  
 	 	 $ ( " # u s e r n a m e _ c h e c k " ) . h t m l ( " < i m g   s r c = \ " c s s / i m a g e s / g r e e n _ c h e c k . g i f \ "   a l t = \ " "   +   l a n g [ ' 0 0 8 ' ]   +   " \ "   s t y l e = \ " v e r t i c a l - a l i g n :   - 2 0 % ; \ "   / >   < s p a n   s t y l e = \ " c o l o r :   # 0 9 6 ; \ " > "   +   l a n g [ ' 0 0 8 ' ]   +   " < / s p a n >   -   < a   h r e f = \ " j a v a s c r i p t : v o i d ( 0 ) \ "   o n c l i c k = \ " c h e c k _ u s e r n a m e ( ) ; \ " > "   +   l a n g [ ' 0 0 6 ' ]   +   " < / a > " ) ;  
 	 }  
 	 r e t u r n ;  
 }  
  
 f u n c t i o n   h i g h l i g h t ( f i e l d )    
 {  
 	 f i e l d . f o c u s ( ) ;  
 	 f i e l d . s e l e c t ( ) ;  
 	 r e t u r n ;  
 }  
  
 f u n c t i o n   t o g g l e ( i d )    
 {  
 	 $ ( " # "   +   i d ) . t o g g l e ( ) ;  
 	 r e t u r n ;  
 }  
  
 f u n c t i o n   n e w _ f i l e _ i n p u t ( u p l o a d _ t y p e )    
 {  
 	 i f   ( i n d e x _ a m f _ t o t a l   <   i n d e x _ a m f _ m a x )   {  
 	 	 i f   ( u p l o a d _ t y p e   = =   " u r l " )   {  
 	 	 	 $ ( " # m o r e _ f i l e _ i n p u t s " ) . a p p e n d ( " < d i v   i d = \ " f i l e - "   +     i n d e x _ a m f _ t o t a l   +   " \ " > "   +  
 	 	 	 	 	 	 l a n g [ ' 0 0 4 ' ]   +   "   < i n p u t   n a m e = \ " u s e r f i l e [ ] \ "   t y p e = \ " t e x t \ "   s i z e = \ " 5 5 \ "   c l a s s = \ " i n p u t _ f i e l d \ "   / >   "   +  
 	 	 	 	 	 	 " < s p a n   c l a s s = \ " b u t t o n 2 \ "   o n c l i c k = \ " r e m o v e _ f i l e _ i n p u t ( ' f i l e - "   +   i n d e x _ a m f _ t o t a l   +   " ' ) ; \ " > "   +   l a n g [ ' 0 0 2 ' ]   +   " < / s p a n >   < b r   / > "   +  
 	 	 	 	 	 	 " < / d i v > " ) ;  
 	 	 }   e l s e   {  
 	 	 	 $ ( " # m o r e _ f i l e _ i n p u t s " ) . a p p e n d ( " < d i v   i d = \ " f i l e - "   +     i n d e x _ a m f _ t o t a l   +   " \ " > "   +  
 	 	 	 	 	 	 " < i n p u t   n a m e = \ " u s e r f i l e [ ] \ "   t y p e = \ " f i l e \ "   s i z e = \ " 5 0 \ "   / >   "   +  
 	 	 	 	 	 	 " < s p a n   c l a s s = \ " b u t t o n 2 \ "   o n c l i c k = \ " r e m o v e _ f i l e _ i n p u t ( ' f i l e - "   +   i n d e x _ a m f _ t o t a l   +   " ' ) ; \ " > "   +   l a n g [ ' 0 0 2 ' ]   +   " < / s p a n >   < b r   / > "   +  
 	 	 	 	 	 	 " < / d i v > " ) ;  
 	 	 }  
 	 	 i n d e x _ a m f _ t o t a l + + ;  
 	 }   e l s e   {  
 	 	 a l e r t ( l a n g [ ' 0 0 3 ' ] ) ;  
 	 }  
 	 r e t u r n ;  
 }  
  
 f u n c t i o n   r e m o v e _ f i l e _ i n p u t ( d i v )  
 {  
 	 $ ( " # "   +   d i v ) . r e m o v e ( ) ;  
 	 r e t u r n ;  
 }  
  
 
