ÿþ/ *  
   *   T h i c k b o x   3 . 1   -   O n e   B o x   T o   R u l e   T h e m   A l l .  
   *   B y   C o d y   L i n d l e y   ( h t t p : / / w w w . c o d y l i n d l e y . c o m )  
   *   C o p y r i g h t   ( c )   2 0 0 7   c o d y   l i n d l e y  
   *   L i c e n s e d   u n d e r   t h e   M I T   L i c e n s e :   h t t p : / / w w w . o p e n s o u r c e . o r g / l i c e n s e s / m i t - l i c e n s e . p h p  
 * /  
 	 	      
 v a r   t b _ p a t h T o I m a g e   =   " _ i m g / l o a d i n g A n i m a t i o n . g i f " ;  
  
 / * ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !   e d i t   b e l o w   t h i s   l i n e   a t   y o u r   o w n   r i s k   ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! * /  
  
 / / o n   p a g e   l o a d   c a l l   t b _ i n i t  
 $ ( d o c u m e n t ) . r e a d y ( f u n c t i o n ( )   {  
         t b _ i n i t ( ' a . t h i c k b o x ,   a r e a . t h i c k b o x ,   i n p u t . t h i c k b o x ' ) ;   / / p a s s   w h e r e   t o   a p p l y   t h i c k b o x  
         i m g L o a d e r   =   n e w   I m a g e ( ) ;   / /   p r e l o a d   i m a g e  
         i m g L o a d e r . s r c   =   t b _ p a t h T o I m a g e ;  
 } ) ;  
  
 / / a d d   t h i c k b o x   t o   h r e f   &   a r e a   e l e m e n t s   t h a t   h a v e   a   c l a s s   o f   . t h i c k b o x  
 f u n c t i o n   t b _ i n i t ( d o m C h u n k ) {  
 	 $ ( d o m C h u n k ) . c l i c k ( f u n c t i o n ( ) {  
 	 v a r   t   =   t h i s . t i t l e   | |   t h i s . n a m e   | |   n u l l ;  
 	 v a r   a   =   t h i s . h r e f   | |   t h i s . a l t ;  
 	 v a r   g   =   t h i s . r e l   | |   f a l s e ;  
 	 t b _ s h o w ( t , a , g ) ;  
 	 t h i s . b l u r ( ) ;  
 	 r e t u r n   f a l s e ;  
 	 } ) ;  
 }  
  
 f u n c t i o n   t b _ s h o w ( c a p t i o n ,   u r l ,   i m a g e G r o u p )   { / / f u n c t i o n   c a l l e d   w h e n   t h e   u s e r   c l i c k s   o n   a   t h i c k b o x   l i n k  
 	 t r y   {  
 	 	 i f   ( t y p e o f   d o c u m e n t . b o d y . s t y l e . m a x H e i g h t   = = =   " u n d e f i n e d " )   { / / i f   I E   6  
 	 	 	 $ ( " b o d y " , " h t m l " ) . c s s ( { h e i g h t :   " 1 0 0 % " ,   w i d t h :   " 1 0 0 % " } ) ;  
 	 	 	 $ ( " h t m l " ) . c s s ( " o v e r f l o w " , " h i d d e n " ) ;  
 	 	 	 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( " T B _ H i d e S e l e c t " )   = = =   n u l l )   { / / i f r a m e   t o   h i d e   s e l e c t   e l e m e n t s   i n   i e 6  
 	 	 	 	 $ ( " b o d y " ) . a p p e n d ( " < i f r a m e   i d = ' T B _ H i d e S e l e c t ' > < / i f r a m e > < d i v   i d = ' T B _ o v e r l a y ' > < / d i v > < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
 	 	 	 	 $ ( " # T B _ o v e r l a y " ) . c l i c k ( t b _ r e m o v e ) ;  
 	 	 	 }  
 	 	 } e l s e { / / a l l   o t h e r s  
 	 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( " T B _ o v e r l a y " )   = = =   n u l l ) {  
 	 	 	 	 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ o v e r l a y ' > < / d i v > < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
 	 	 	 	 $ ( " # T B _ o v e r l a y " ) . c l i c k ( t b _ r e m o v e ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 i f ( t b _ d e t e c t M a c X F F ( ) ) {  
 	 	 	 $ ( " # T B _ o v e r l a y " ) . a d d C l a s s ( " T B _ o v e r l a y M a c F F B G H a c k " ) ; / / u s e   p n g   o v e r l a y   s o   h i d e   f l a s h  
 	 	 } e l s e {  
 	 	 	 $ ( " # T B _ o v e r l a y " ) . a d d C l a s s ( " T B _ o v e r l a y B G " ) ; / / u s e   b a c k g r o u n d   a n d   o p a c i t y  
 	 	 }  
  
 	 	 i f ( c a p t i o n = = = n u l l ) { c a p t i o n = " " ; }  
 	 	 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ l o a d ' > < i m g   s r c = ' " + i m g L o a d e r . s r c + " '   / > < / d i v > " ) ; / / a d d   l o a d e r   t o   t h e   p a g e  
 	 	 $ ( ' # T B _ l o a d ' ) . s h o w ( ) ; / / s h o w   l o a d e r  
 	 	  
 	 	 v a r   b a s e U R L ;  
 	       i f ( u r l . i n d e x O f ( " ? " ) ! = = - 1 ) {   / / f f   t h e r e   i s   a   q u e r y   s t r i n g   i n v o l v e d  
 	 	 	 b a s e U R L   =   u r l . s u b s t r ( 0 ,   u r l . i n d e x O f ( " ? " ) ) ;  
 	       } e l s e {    
 	       	 	 b a s e U R L   =   u r l ;  
 	       }  
  
 	       v a r   u r l S t r i n g   =   / \ . j p g $ | \ . j p e g $ | \ . p n g $ | \ . g i f $ | \ . b m p $ / ;  
 	       v a r   u r l T y p e   =   b a s e U R L . t o L o w e r C a s e ( ) . m a t c h ( u r l S t r i n g ) ;  
  
 	 	 i f ( u r l T y p e   = =   ' . j p g '   | |   u r l T y p e   = =   ' . j p e g '   | |   u r l T y p e   = =   ' . p n g '   | |   u r l T y p e   = =   ' . g i f '   | |   u r l T y p e   = =   ' . b m p ' ) { / / c o d e   t o   s h o w   i m a g e s  
  
 	 	 	 	 	 	                  
 	 	 	 T B _ P r e v C a p t i o n   =   " " ;  
 	 	 	 T B _ P r e v U R L   =   " " ;  
 	 	 	 T B _ P r e v H T M L   =   " " ;  
 	 	 	 T B _ N e x t C a p t i o n   =   " " ;  
 	 	 	 T B _ N e x t U R L   =   " " ;  
 	 	 	 T B _ N e x t H T M L   =   " " ;  
 	 	 	 T B _ i m a g e C o u n t   =   " " ;  
 	 	 	 T B _ F o u n d U R L   =   f a l s e ;  
 	 	 	 i f   ( i m a g e G r o u p )   {  
 	 	 	         T B _ T e m p A r r a y   =   $ ( " a [ r e l = "   +   i m a g e G r o u p   +   " ] " ) . g e t ( ) ;    
 	 	 	 	 f o r   ( T B _ C o u n t e r   =   0 ;   ( ( T B _ C o u n t e r   <   T B _ T e m p A r r a y . l e n g t h )   & &   ( T B _ N e x t H T M L   = = =   " " ) ) ;   T B _ C o u n t e r + + )   {  
 	 	 	 	         v a r   u r l T y p e T e m p   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f . t o L o w e r C a s e ( ) . m a t c h ( u r l S t r i n g ) ;  
 	 	 	 	 	 	 i f   ( ! ( T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f   = =   u r l ) )   {  
 	 	 	 	 	 	         i f   ( T B _ F o u n d U R L )   {  
 	 	 	 	 	 	 	 	 T B _ N e x t C a p t i o n   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . t i t l e ;  
 	 	 	 	 	 	 	 	 T B _ N e x t U R L   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f ;  
 	 	 	 	 	 	 	 	 i f   ( T h i c k B o x N e x t   ! =   ' ' )  
 	 	 	 	 	 	 	 	         T B _ N e x t H T M L   =   " < s p a n   i d = ' T B _ n e x t ' > & n b s p ; & n b s p ; < a   h r e f = ' # ' > "   +   T h i c k B o x N e x t   +   " < / a > < / s p a n > " ;  
 	 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 	 T B _ N e x t H T M L   =   " < s p a n   i d = ' T B _ n e x t ' > & n b s p ; & n b s p ; < a   h r e f = ' # ' > N e x t   & g t ; < / a > < / s p a n > " ;  
 	 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 	 T B _ P r e v C a p t i o n   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . t i t l e ;  
 	 	 	 	 	 	 	 	 T B _ P r e v U R L   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f ;  
 	 	 	 	 	 	 	 	 i f   ( T h i c k B o x P r e v i o u s   ! =   ' ' )  
 	 	 	 	 	 	 	 	         T B _ P r e v H T M L   =   " < s p a n   i d = ' T B _ p r e v ' > & n b s p ; & n b s p ; < a   h r e f = ' # ' > "   +   T h i c k B o x P r e v i o u s   +   " < / a > < / s p a n > " ;  
 	 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	         T B _ P r e v H T M L   =   " < s p a n   i d = ' T B _ p r e v ' > & n b s p ; & n b s p ; < a   h r e f = ' # ' > & l t ;   P r e v < / a > < / s p a n > " ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 T B _ F o u n d U R L   =   t r u e ;  
 	 	 	 	 	 	 n r   =   T B _ C o u n t e r   +   1 ;  
 	 	 	 	 	 	 a l l   =   T B _ T e m p A r r a y . l e n g t h ;  
 	 	 	 	 	 	 i f   ( T h i c k B o x I m a g e O f   ! =   ' ' )   {  
 	 	 	 	 	 	         T B _ i m a g e C o u n t   =   T h i c k B o x I m a g e O f . r e p l a c e ( " { 0 } " ,   n r ) . r e p l a c e ( " { 1 } " ,   a l l ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	         T B _ i m a g e C o u n t   =   " I m a g e   "   +   n r   +   "   o f   "   +   a l l ;  
 	 	 	 	 	 	 } 	 	 	 	 	 	 	 	 	  
 	 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
  
 	 	 	 i m g P r e l o a d e r   =   n e w   I m a g e ( ) ;  
 	 	 	 i m g P r e l o a d e r . o n l o a d   =   f u n c t i o n ( ) { 	 	  
 	 	 	 i m g P r e l o a d e r . o n l o a d   =   n u l l ;  
 	 	 	 	  
 	 	 	 / /   R e s i z i n g   l a r g e   i m a g e s   -   o r g i n a l   b y   C h r i s t i a n   M o n t o y a   e d i t e d   b y   m e .  
 	 	 	 v a r   p a g e s i z e   =   t b _ g e t P a g e S i z e ( ) ;  
 	 	 	 v a r   x   =   p a g e s i z e [ 0 ]   -   1 5 0 ;  
 	 	 	 v a r   y   =   p a g e s i z e [ 1 ]   -   1 5 0 ;  
 	 	 	 v a r   i m a g e W i d t h   =   i m g P r e l o a d e r . w i d t h ;  
 	 	 	 v a r   i m a g e H e i g h t   =   i m g P r e l o a d e r . h e i g h t ;  
 	 	 	 i f   ( i m a g e W i d t h   >   x )   {  
 	 	 	 	 i m a g e H e i g h t   =   i m a g e H e i g h t   *   ( x   /   i m a g e W i d t h ) ;    
 	 	 	 	 i m a g e W i d t h   =   x ;    
 	 	 	 	 i f   ( i m a g e H e i g h t   >   y )   {    
 	 	 	 	 	 i m a g e W i d t h   =   i m a g e W i d t h   *   ( y   /   i m a g e H e i g h t ) ;    
 	 	 	 	 	 i m a g e H e i g h t   =   y ;    
 	 	 	 	 }  
 	 	 	 }   e l s e   i f   ( i m a g e H e i g h t   >   y )   {    
 	 	 	 	 i m a g e W i d t h   =   i m a g e W i d t h   *   ( y   /   i m a g e H e i g h t ) ;    
 	 	 	 	 i m a g e H e i g h t   =   y ;    
 	 	 	 	 i f   ( i m a g e W i d t h   >   x )   {    
 	 	 	 	 	 i m a g e H e i g h t   =   i m a g e H e i g h t   *   ( x   /   i m a g e W i d t h ) ;    
 	 	 	 	 	 i m a g e W i d t h   =   x ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / /   E n d   R e s i z i n g  
 	 	 	  
 	 	 	 T B _ W I D T H   =   i m a g e W i d t h   +   3 0 ;  
 	 	 	 T B _ H E I G H T   =   i m a g e H e i g h t   +   6 0 ;  
 	 	 	 $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < a   h r e f = ' '   i d = ' T B _ I m a g e O f f '   t i t l e = ' C l o s e ' > < i m g   i d = ' T B _ I m a g e '   s r c = ' " + u r l + " '   w i d t h = ' " + i m a g e W i d t h + " '   h e i g h t = ' " + i m a g e H e i g h t + " '   a l t = ' " + c a p t i o n + " ' / > < / a > "   +   " < d i v   i d = ' T B _ c a p t i o n ' > " + c a p t i o n + " < d i v   i d = ' T B _ s e c o n d L i n e ' > "   +   T B _ i m a g e C o u n t   +   T B _ P r e v H T M L   +   T B _ N e x t H T M L   +   " < / d i v > < / d i v > < d i v   i d = ' T B _ c l o s e W i n d o w ' > < a   h r e f = ' # '   i d = ' T B _ c l o s e W i n d o w B u t t o n '   t i t l e = ' C l o s e ' > ( X ) < / a > < / d i v > " ) ;   	 	  
 	 	 	  
 	 	 	 $ ( " # T B _ c l o s e W i n d o w B u t t o n " ) . c l i c k ( t b _ r e m o v e ) ;  
 	 	 	  
 	 	 	 i f   ( ! ( T B _ P r e v H T M L   = = =   " " ) )   {  
 	 	 	 	 f u n c t i o n   g o P r e v ( ) {  
 	 	 	 	 	 i f ( $ ( d o c u m e n t ) . u n b i n d ( " c l i c k " , g o P r e v ) ) { $ ( d o c u m e n t ) . u n b i n d ( " c l i c k " , g o P r e v ) ; }  
 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . r e m o v e ( ) ;  
 	 	 	 	 	 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
 	 	 	 	 	 t b _ s h o w ( T B _ P r e v C a p t i o n ,   T B _ P r e v U R L ,   i m a g e G r o u p ) ;  
 	 	 	 	 	 r e t u r n   f a l s e ; 	  
 	 	 	 	 }  
 	 	 	 	 $ ( " # T B _ p r e v " ) . c l i c k ( g o P r e v ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 i f   ( ! ( T B _ N e x t H T M L   = = =   " " ) )   { 	 	  
 	 	 	 	 f u n c t i o n   g o N e x t ( ) {  
 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . r e m o v e ( ) ;  
 	 	 	 	 	 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
 	 	 	 	 	 t b _ s h o w ( T B _ N e x t C a p t i o n ,   T B _ N e x t U R L ,   i m a g e G r o u p ) ; 	 	 	 	  
 	 	 	 	 	 r e t u r n   f a l s e ; 	  
 	 	 	 	 }  
 	 	 	 	 $ ( " # T B _ n e x t " ) . c l i c k ( g o N e x t ) ;  
 	 	 	 	  
 	 	 	 }  
  
 	 	 	 d o c u m e n t . o n k e y d o w n   =   f u n c t i o n ( e ) {   	  
 	 	 	 	 i f   ( e   = =   n u l l )   {   / /   i e  
 	 	 	 	 	 k e y c o d e   =   e v e n t . k e y C o d e ;  
 	 	 	 	 }   e l s e   {   / /   m o z i l l a  
 	 	 	 	 	 k e y c o d e   =   e . w h i c h ;  
 	 	 	 	 }  
 	 	 	 	 i f ( k e y c o d e   = =   2 7 ) {   / /   c l o s e  
 	 	 	 	 	 t b _ r e m o v e ( ) ;  
 	 	 	 	 }   e l s e   i f ( k e y c o d e   = =   1 9 0 ) {   / /   d i s p l a y   p r e v i o u s   i m a g e  
 	 	 	 	 	 i f ( ! ( T B _ N e x t H T M L   = =   " " ) ) {  
 	 	 	 	 	 	 d o c u m e n t . o n k e y d o w n   =   " " ;  
 	 	 	 	 	 	 g o N e x t ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 }   e l s e   i f ( k e y c o d e   = =   1 8 8 ) {   / /   d i s p l a y   n e x t   i m a g e  
 	 	 	 	 	 i f ( ! ( T B _ P r e v H T M L   = =   " " ) ) {  
 	 	 	 	 	 	 d o c u m e n t . o n k e y d o w n   =   " " ;  
 	 	 	 	 	 	 g o P r e v ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 } 	  
 	 	 	 } ;  
 	 	 	  
 	 	 	 t b _ p o s i t i o n ( ) ;  
 	 	 	 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
 	 	 	 $ ( " # T B _ I m a g e O f f " ) . c l i c k ( t b _ r e m o v e ) ;  
 	 	 	 $ ( " # T B _ w i n d o w " ) . c s s ( { d i s p l a y : " b l o c k " } ) ;   / / f o r   s a f a r i   u s i n g   c s s   i n s t e a d   o f   s h o w  
 	 	 	 } ;  
 	 	 	  
 	 	 	 i m g P r e l o a d e r . s r c   =   u r l ;  
 	 	 } e l s e { / / c o d e   t o   s h o w   h t m l  
 	 	 	  
 	 	 	 v a r   q u e r y S t r i n g   =   u r l . r e p l a c e ( / ^ [ ^ \ ? ] + \ ? ? / , ' ' ) ;  
 	 	 	 v a r   p a r a m s   =   t b _ p a r s e Q u e r y (   q u e r y S t r i n g   ) ;  
  
 	 	 	 T B _ W I D T H   =   ( p a r a m s [ ' w i d t h ' ] * 1 )   +   3 0   | |   6 3 0 ;   / / d e f a u l t s   t o   6 3 0   i f   n o   p a r a m a t e r s   w e r e   a d d e d   t o   U R L  
 	 	 	 T B _ H E I G H T   =   ( p a r a m s [ ' h e i g h t ' ] * 1 )   +   4 0   | |   4 4 0 ;   / / d e f a u l t s   t o   4 4 0   i f   n o   p a r a m a t e r s   w e r e   a d d e d   t o   U R L  
 	 	 	 a j a x C o n t e n t W   =   T B _ W I D T H   -   3 0 ;  
 	 	 	 a j a x C o n t e n t H   =   T B _ H E I G H T   -   4 5 ;  
 	 	 	  
 	 	 	 i f ( u r l . i n d e x O f ( ' T B _ i f r a m e ' )   ! =   - 1 ) { / /   e i t h e r   i f r a m e   o r   a j a x   w i n d o w 	 	  
 	 	 	 	 	 u r l N o Q u e r y   =   u r l . s p l i t ( ' T B _ ' ) ;  
 	 	 	 	 	 $ ( " # T B _ i f r a m e C o n t e n t " ) . r e m o v e ( ) ;  
 	 	 	 	 	 i f ( p a r a m s [ ' m o d a l ' ]   ! =   " t r u e " ) { / / i f r a m e   n o   m o d a l  
 	 	 	 	 	         $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < d i v   i d = ' T B _ t i t l e ' > < d i v   i d = ' T B _ a j a x W i n d o w T i t l e ' > "   +   c a p t i o n   +   " < / d i v > < d i v   i d = ' T B _ c l o s e A j a x W i n d o w ' > < a   h r e f = ' # '   i d = ' T B _ c l o s e W i n d o w B u t t o n '   t i t l e = ' C l o s e ' > ( X ) < / a > < / d i v > < / d i v > < i f r a m e   f r a m e b o r d e r = ' 0 '   h s p a c e = ' 0 '   s r c = ' "   +   u r l N o Q u e r y [ 0 ]   +   " '   i d = ' T B _ i f r a m e C o n t e n t '   n a m e = ' T B _ i f r a m e C o n t e n t "   +   M a t h . r o u n d ( M a t h . r a n d o m ( )   *   1 0 0 0 )   +   " '   o n l o a d = ' t b _ s h o w I f r a m e ( ) '   s t y l e = ' w i d t h : "   +   ( a j a x C o n t e n t W   +   2 9 )   +   " p x ; h e i g h t : "   +   ( a j a x C o n t e n t H   +   1 7 )   +   " p x ; '   >   < / i f r a m e > " ) ;  
 	 	 	 	 	 } e l s e { / / i f r a m e   m o d a l  
 	 	 	 	 	 $ ( " # T B _ o v e r l a y " ) . u n b i n d ( ) ;  
 	 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < i f r a m e   f r a m e b o r d e r = ' 0 '   h s p a c e = ' 0 '   s r c = ' " + u r l N o Q u e r y [ 0 ] + " '   i d = ' T B _ i f r a m e C o n t e n t '   n a m e = ' T B _ i f r a m e C o n t e n t " + M a t h . r o u n d ( M a t h . r a n d o m ( ) * 1 0 0 0 ) + " '   o n l o a d = ' t b _ s h o w I f r a m e ( ) '   s t y l e = ' w i d t h : " + ( a j a x C o n t e n t W   +   2 9 ) + " p x ; h e i g h t : " + ( a j a x C o n t e n t H   +   1 7 ) + " p x ; ' >   < / i f r a m e > " ) ;  
 	 	 	 	 	 }  
 	 	 	 } e l s e { / /   n o t   a n   i f r a m e ,   a j a x  
 	 	 	 	 	 i f ( $ ( " # T B _ w i n d o w " ) . c s s ( " d i s p l a y " )   ! =   " b l o c k " ) {  
 	 	 	 	 	 	 i f ( p a r a m s [ ' m o d a l ' ]   ! =   " t r u e " ) { / / a j a x   n o   m o d a l  
 	 	 	 	 	 	         $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < d i v   i d = ' T B _ t i t l e ' > < d i v   i d = ' T B _ a j a x W i n d o w T i t l e ' > "   +   c a p t i o n   +   " < / d i v > < d i v   i d = ' T B _ c l o s e A j a x W i n d o w ' > < a   h r e f = ' # '   i d = ' T B _ c l o s e W i n d o w B u t t o n ' > ( X ) < / a > < / d i v > < / d i v > < d i v   i d = ' T B _ a j a x C o n t e n t '   s t y l e = ' w i d t h : "   +   a j a x C o n t e n t W   +   " p x ; h e i g h t : "   +   a j a x C o n t e n t H   +   " p x ' > < / d i v > " ) ;  
 	 	 	 	 	 	 } e l s e { / / a j a x   m o d a l  
 	 	 	 	 	 	 $ ( " # T B _ o v e r l a y " ) . u n b i n d ( ) ;  
 	 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < d i v   i d = ' T B _ a j a x C o n t e n t '   c l a s s = ' T B _ m o d a l '   s t y l e = ' w i d t h : " + a j a x C o n t e n t W + " p x ; h e i g h t : " + a j a x C o n t e n t H + " p x ; ' > < / d i v > " ) ; 	  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } e l s e { / / t h i s   m e a n s   t h e   w i n d o w   i s   a l r e a d y   u p ,   w e   a r e   j u s t   l o a d i n g   n e w   c o n t e n t   v i a   a j a x  
 	 	 	 	 	 	 $ ( " # T B _ a j a x C o n t e n t " ) [ 0 ] . s t y l e . w i d t h   =   a j a x C o n t e n t W   + " p x " ;  
 	 	 	 	 	 	 $ ( " # T B _ a j a x C o n t e n t " ) [ 0 ] . s t y l e . h e i g h t   =   a j a x C o n t e n t H   + " p x " ;  
 	 	 	 	 	 	 $ ( " # T B _ a j a x C o n t e n t " ) [ 0 ] . s c r o l l T o p   =   0 ;  
 	 	 	 	 	 	 $ ( " # T B _ a j a x W i n d o w T i t l e " ) . h t m l ( c a p t i o n ) ;  
 	 	 	 	 	 }  
 	 	 	 }  
 	 	 	 	 	  
 	 	 	 $ ( " # T B _ c l o s e W i n d o w B u t t o n " ) . c l i c k ( t b _ r e m o v e ) ;  
 	 	 	  
 	 	 	 	 i f ( u r l . i n d e x O f ( ' T B _ i n l i n e ' )   ! =   - 1 ) { 	  
 	 	 	 	 	 $ ( " # T B _ a j a x C o n t e n t " ) . a p p e n d ( $ ( ' # '   +   p a r a m s [ ' i n l i n e I d ' ] ) . c h i l d r e n ( ) ) ;  
 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . u n l o a d ( f u n c t i o n   ( )   {  
 	 	 	 	 	 	 $ ( ' # '   +   p a r a m s [ ' i n l i n e I d ' ] ) . a p p e n d (   $ ( " # T B _ a j a x C o n t e n t " ) . c h i l d r e n ( )   ) ;   / /   m o v e   e l e m e n t s   b a c k   w h e n   y o u ' r e   f i n i s h e d  
 	 	 	 	 	 } ) ;  
 	 	 	 	 	 t b _ p o s i t i o n ( ) ;  
 	 	 	 	 	 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . c s s ( { d i s p l a y : " b l o c k " } ) ;    
 	 	 	 	 } e l s e   i f ( u r l . i n d e x O f ( ' T B _ i f r a m e ' )   ! =   - 1 ) {  
 	 	 	 	 	 t b _ p o s i t i o n ( ) ;  
 	 	 	 	 	 i f ( $ . b r o w s e r . s a f a r i ) { / / s a f a r i   n e e d s   h e l p   b e c a u s e   i t   w i l l   n o t   f i r e   i f r a m e   o n l o a d  
 	 	 	 	 	 	 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
 	 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . c s s ( { d i s p l a y : " b l o c k " } ) ;  
 	 	 	 	 	 }  
 	 	 	 	 } e l s e {  
 	 	 	 	 	 $ ( " # T B _ a j a x C o n t e n t " ) . l o a d ( u r l   + =   " & r a n d o m = "   +   ( n e w   D a t e ( ) . g e t T i m e ( ) ) , f u n c t i o n ( ) { / / t o   d o   a   p o s t   c h a n g e   t h i s   l o a d   m e t h o d  
 	 	 	 	 	 	 t b _ p o s i t i o n ( ) ;  
 	 	 	 	 	 	 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
 	 	 	 	 	 	 t b _ i n i t ( " # T B _ a j a x C o n t e n t   a . t h i c k b o x " ) ;  
 	 	 	 	 	 	 $ ( " # T B _ w i n d o w " ) . c s s ( { d i s p l a y : " b l o c k " } ) ;  
 	 	 	 	 	 } ) ;  
 	 	 	 	 }  
 	 	 	  
 	 	 }  
  
 	 	 i f ( ! p a r a m s [ ' m o d a l ' ] ) {  
 	 	 	 d o c u m e n t . o n k e y u p   =   f u n c t i o n ( e ) {   	  
 	 	 	 	 i f   ( e   = =   n u l l )   {   / /   i e  
 	 	 	 	 	 k e y c o d e   =   e v e n t . k e y C o d e ;  
 	 	 	 	 }   e l s e   {   / /   m o z i l l a  
 	 	 	 	 	 k e y c o d e   =   e . w h i c h ;  
 	 	 	 	 }  
 	 	 	 	 i f ( k e y c o d e   = =   2 7 ) {   / /   c l o s e  
 	 	 	 	 	 t b _ r e m o v e ( ) ;  
 	 	 	 	 } 	  
 	 	 	 } ;  
 	 	 }  
 	 	  
 	 }   c a t c h ( e )   {  
 	 	 / / n o t h i n g   h e r e  
 	 }  
 }  
  
 / / h e l p e r   f u n c t i o n s   b e l o w  
 f u n c t i o n   t b _ s h o w I f r a m e ( ) {  
 	 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
 	 $ ( " # T B _ w i n d o w " ) . c s s ( { d i s p l a y : " b l o c k " } ) ;  
 }  
  
 f u n c t i o n   t b _ r e m o v e ( )   {  
   	 $ ( " # T B _ i m a g e O f f " ) . u n b i n d ( " c l i c k " ) ;  
 	 $ ( " # T B _ c l o s e W i n d o w B u t t o n " ) . u n b i n d ( " c l i c k " ) ;  
 	 $ ( " # T B _ w i n d o w " ) . f a d e O u t ( " f a s t " , f u n c t i o n ( ) { $ ( ' # T B _ w i n d o w , # T B _ o v e r l a y , # T B _ H i d e S e l e c t ' ) . t r i g g e r ( " u n l o a d " ) . u n b i n d ( ) . r e m o v e ( ) ; } ) ;  
 	 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
 	 i f   ( t y p e o f   d o c u m e n t . b o d y . s t y l e . m a x H e i g h t   = =   " u n d e f i n e d " )   { / / i f   I E   6  
 	 	 $ ( " b o d y " , " h t m l " ) . c s s ( { h e i g h t :   " a u t o " ,   w i d t h :   " a u t o " } ) ;  
 	 	 $ ( " h t m l " ) . c s s ( " o v e r f l o w " , " " ) ;  
 	 }  
 	 d o c u m e n t . o n k e y d o w n   =   " " ;  
 	 d o c u m e n t . o n k e y u p   =   " " ;  
 	 r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   t b _ p o s i t i o n ( )   {  
 $ ( " # T B _ w i n d o w " ) . c s s ( { m a r g i n L e f t :   ' - '   +   p a r s e I n t ( ( T B _ W I D T H   /   2 ) , 1 0 )   +   ' p x ' ,   w i d t h :   T B _ W I D T H   +   ' p x ' } ) ;  
 	 i f   (   ! ( j Q u e r y . b r o w s e r . m s i e   & &   j Q u e r y . b r o w s e r . v e r s i o n   <   7 ) )   {   / /   t a k e   a w a y   I E 6  
 	 	 $ ( " # T B _ w i n d o w " ) . c s s ( { m a r g i n T o p :   ' - '   +   p a r s e I n t ( ( T B _ H E I G H T   /   2 ) , 1 0 )   +   ' p x ' } ) ;  
 	 }  
 }  
  
 f u n c t i o n   t b _ p a r s e Q u e r y   (   q u e r y   )   {  
       v a r   P a r a m s   =   { } ;  
       i f   (   !   q u e r y   )   { r e t u r n   P a r a m s ; } / /   r e t u r n   e m p t y   o b j e c t  
       v a r   P a i r s   =   q u e r y . s p l i t ( / [ ; & ] / ) ;  
       f o r   (   v a r   i   =   0 ;   i   <   P a i r s . l e n g t h ;   i + +   )   {  
             v a r   K e y V a l   =   P a i r s [ i ] . s p l i t ( ' = ' ) ;  
             i f   (   !   K e y V a l   | |   K e y V a l . l e n g t h   ! =   2   )   { c o n t i n u e ; }  
             v a r   k e y   =   u n e s c a p e (   K e y V a l [ 0 ]   ) ;  
             v a r   v a l   =   u n e s c a p e (   K e y V a l [ 1 ]   ) ;  
             v a l   =   v a l . r e p l a c e ( / \ + / g ,   '   ' ) ;  
             P a r a m s [ k e y ]   =   v a l ;  
       }  
       r e t u r n   P a r a m s ;  
 }  
  
 f u n c t i o n   t b _ g e t P a g e S i z e ( ) {  
 	 v a r   d e   =   d o c u m e n t . d o c u m e n t E l e m e n t ;  
 	 v a r   w   =   w i n d o w . i n n e r W i d t h   | |   s e l f . i n n e r W i d t h   | |   ( d e & & d e . c l i e n t W i d t h )   | |   d o c u m e n t . b o d y . c l i e n t W i d t h ;  
 	 v a r   h   =   w i n d o w . i n n e r H e i g h t   | |   s e l f . i n n e r H e i g h t   | |   ( d e & & d e . c l i e n t H e i g h t )   | |   d o c u m e n t . b o d y . c l i e n t H e i g h t ;  
 	 a r r a y P a g e S i z e   =   [ w , h ] ;  
 	 r e t u r n   a r r a y P a g e S i z e ;  
 }  
  
 f u n c t i o n   t b _ d e t e c t M a c X F F ( )   {  
     v a r   u s e r A g e n t   =   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 ( ) ;  
     i f   ( u s e r A g e n t . i n d e x O f ( ' m a c ' )   ! =   - 1   & &   u s e r A g e n t . i n d e x O f ( ' f i r e f o x ' ) ! = - 1 )   {  
         r e t u r n   t r u e ;  
     }  
 }  
  
  
  
 v a r   t o J s o n S t r i n g  
  
 ( f u n c t i o n ( )   {  
         t o J s o n S t r i n g   =   f u n c t i o n ( o )   {  
                 v a r   U N D E F I N E D  
                 s w i t c h   ( t y p e o f   o )   {  
                         c a s e   ' s t r i n g ' :   r e t u r n   ' \ " '   +   e n c o d e J S ( o )   +   ' \ " '  
                         c a s e   ' n u m b e r ' :   r e t u r n   S t r i n g ( o )  
                         c a s e   ' o b j e c t ' :  
                                 i f   ( o )   {  
                                         v a r   a   =   [ ]  
                                         i f   ( o . c o n s t r u c t o r   = =   A r r a y )   {  
                                                 f o r   ( v a r   i   =   0 ;   i   <   o . l e n g t h ;   i + + )   {  
                                                         v a r   j s o n   =   t o J s o n S t r i n g ( o [ i ] )  
                                                         i f   ( j s o n   ! =   U N D E F I N E D )   a [ a . l e n g t h ]   =   j s o n  
                                                 }  
                                                 r e t u r n   ' [ '   +   a . j o i n ( ' , ' )   +   ' ] '  
                                         }   e l s e   i f   ( o . c o n s t r u c t o r   = =   D a t e )   {  
                                                 r e t u r n   ' n e w   D a t e ( '   +   o . g e t T i m e ( )   +   ' ) '  
                                         }   e l s e   {  
                                                 f o r   ( v a r   p   i n   o )   {  
                                                         i f   ( p   ! =   ' _ _ t y p e ' )   {  
                                                                 v a r   j s o n   =   t o J s o n S t r i n g ( o [ p ] )  
                                                                 i f   ( j s o n   ! =   U N D E F I N E D )   a [ a . l e n g t h ]   =   ( / ^ [ A - Z a - z _ ] \ w * $ / . t e s t ( p )   ?   ( ' \ " '   +   p   +   ' \ " '   +   ' : ' )   :   ( ' \ " '   +   e n c o d e J S ( p )   +   ' \ " : ' ) )   +   j s o n  
                                                         }  
                                                 }  
                                                 r e t u r n   ' { '   +   a . j o i n ( ' , ' )   +   ' } '  
                                         }  
                                 }  
                                 r e t u r n   ' n u l l '  
                         c a s e   ' b o o l e a n ' :   r e t u r n   S t r i n g ( o )  
                         c a s e   ' f u n c t i o n ' :   r e t u r n  
                         c a s e   ' u n d e f i n e d ' :   r e t u r n   ' n u l l '  
                 }  
         }  
  
         f u n c t i o n   e n c o d e J S ( s )   {  
                 r e t u r n   ( ! / [ \ x 0 0 - \ x 1 9 \ ' \ \ ] / . t e s t ( s ) )   ?   s   :   s . r e p l a c e ( / ( [ \ \ ' ] ) / g ,   ' \ \ $ 1 ' ) . r e p l a c e ( / \ r / g ,   ' \ \ r ' ) . r e p l a c e ( / \ n / g ,   ' \ \ n ' ) . r e p l a c e ( / \ t / g ,   ' \ \ t ' ) . r e p l a c e ( / [ \ x 0 0 - \ x 1 9 ] / g ,   ' ' )  
         }  
 } ) ( )  
 M i l l i o n Y o u B a s e   =   f u n c t i o n ( )   {  
         t h i s . l o a d e r s C o u n t   =   0 ;  
         t h i s . f i x P n g S e l e c t o r   =   ' . b o x H e a d e r   i m g ,   # p a g e F o o t e r   i m g ,   . p r o f i l e A b o u t M e   i m g ' ;  
 }  
 M i l l i o n Y o u B a s e . p r o t o t y p e   =   {  
  
         G e t F c k E d i t o r P l a i n T e x t L e n g t h :   f u n c t i o n ( f c k i d )   {  
                 v a r   f c k   =   F C K e d i t o r A P I . G e t I n s t a n c e ( f c k i d ) ;  
                 v a r   h t m l c o n t e n t   =   f c k . G e t H T M L ( ) ;  
                 v a r   s t r T a g S t r i p p e d T e x t   =   h t m l c o n t e n t . r e p l a c e ( / < \ / ? [ ^ > ] + ( > | $ ) / g ,   " " ) ;  
                 v a r   s u b S e c t i o n   =   s t r T a g S t r i p p e d T e x t . s u b s t r i n g ( s t r T a g S t r i p p e d T e x t . l e n g t h   -   6 ,   s t r T a g S t r i p p e d T e x t . l e n g t h ) ;  
                 / / O p e r a   d o d a j e   s p a c j e   n a   k o n i e c   : /  
                 v a r   b r o w s e r N a m e   =   n a v i g a t o r . a p p N a m e ;  
                 i f   ( b r o w s e r N a m e   = =   " O p e r a " )  
                         i f   ( s u b S e c t i o n   = =   " & n b s p ; " )   {  
                         s t r T a g S t r i p p e d T e x t   =   s t r T a g S t r i p p e d T e x t . s u b s t r i n g ( 0 ,   s t r T a g S t r i p p e d T e x t . l e n g t h   -   6 ) ;  
                 }  
                 s t r T a g S t r i p p e d T e x t   =   s t r T a g S t r i p p e d T e x t . r e p l a c e ( / & n b s p ; / g ,   "   " ) ;  
                 s t r T a g S t r i p p e d T e x t   =   s t r T a g S t r i p p e d T e x t . r e p l a c e ( / & o a c u t e ; / g ,   " ó " ) ;  
                 r e t u r n   s t r T a g S t r i p p e d T e x t . l e n g t h ;  
         } ,  
  
         S h o w L o a d e r :   f u n c t i o n ( )   {  
                 i f   ( t h i s . l o a d e r s C o u n t   = =   0 )  
                         s h o w A j a x L o a d e r ( ) ;  
                 t h i s . l o a d e r s C o u n t + + ;  
         } ,  
  
         H i d e L o a d e r :   f u n c t i o n ( )   {  
                 i f   ( t h i s . l o a d e r s C o u n t   = =   1 )  
                         h i d e A j a x L o a d e r ( ) ;  
                 i f   ( t h i s . l o a d e r s C o u n t   >   0 )  
                         t h i s . l o a d e r s C o u n t - - ;  
         } ,  
         F i x P n g :   f u n c t i o n ( )   {  
                 $ ( t h i s . f i x P n g S e l e c t o r ) . i f i x p n g ( ) ;  
         } ,  
  
         U n F i x P n g :   f u n c t i o n ( )   {  
                 $ ( t h i s . f i x P n g S e l e c t o r ) . i u n f i x p n g ( ) ;  
         } ,  
  
  
         E m b e d A u d i o P l a y e r :   f u n c t i o n ( u r l ,   d u r a t i o n ,   p r e v S o n g ,   n e x t S o n g ,   b a c k g r o u n d ,   t a r g e t E l e m e n t I d ,   m a i n U r l )   {  
                 v a r   f l a s h v a r s   =   {  
                         j s E n a b l e d :   " t r u e " ,  
                         m p 3 U r l :   u r l ,  
                         m p 3 D u r a t i o n :   d u r a t i o n ,  
                         p r e v S o n g I d :   p r e v S o n g ,  
                         n e x t S o n g I d :   n e x t S o n g ,  
                         b a c k g r o u n d U r l :   ' / p l a y e r s D a t a / b a c k g r o u n d C o l o r H 2 6 0 N o C l o s e . s w f ' ,  
                         a u t o P l a y :   " t r u e " ,  
                         l o g o R e d i r e c t U r l :   m a i n U r l  
                 } ;  
                 v a r   p a r a m s   =   {  
                         l o o p :   " t r u e " ,  
                         m e n u :   " t r u e " ,  
                         q u a l i t y :   " h i g h " ,  
                         s c a l e :   " s h o w a l l " ,  
                         s a l i g n :   " " ,  
                         w m o d e :   " o p a q u e " ,  
                         b g c o l o r :   " # 0 0 0 0 0 0 " ,  
                         b a s e :   " " ,  
                         s w l i v e c o n n e c t :   " " ,  
                         d e v i c e f o n t :   " f a l s e " ,  
                         a l l o w s c r i p t a c c e s s :   " s a m e D o m a i n " ,  
                         s e a m l e s s t a b b i n g :   " " ,  
                         a l l o w F u l l S c r e e n :   " f a l s e " ,  
                         a l l o w n e t w o r k i n g :   " "  
                 } ;  
                 v a r   a t t r i b u t e s   =   {  
                         i d :   " a u d i o P l a y e r " ,  
                         n a m e :   " A u d i o P l a y e r " ,  
                         a l i g n :   " m i d d l e " ,  
                         s t y l e c l a s s :   " "  
                 } ;  
                 s w f o b j e c t . e m b e d S W F ( " / _ p l a y e r s / A u d i o P l a y e r . s w f " ,   t a r g e t E l e m e n t I d ,   " 9 7 0 " ,   " 2 6 0 " ,   " 9 . 0 . 0 " ,   " / _ p l a y e r s / e x p r e s s I n s t a l l . s w f " ,   f l a s h v a r s ,   p a r a m s ,   a t t r i b u t e s ) ;  
         } ,  
  
         E m b e d S i m p l e V i d e o P l a y e r :   f u n c t i o n ( u r l ,   t a r g e t E l e m e n t I d ,   m o v i e W i d t h ,   m o v i e H e i g h t ,   f l a s h W i d t h ,   f l a s h H e i g h t )   {  
                 v a r   f l a s h v a r s   =   {  
                         j s E n a b l e d :   " t r u e " ,  
                         v i d e o U r l :   u r l ,  
                         b a c k g r o u n d U r l :   " # 0 0 0 0 0 0 " ,  
                         a u t o P l a y :   " f a l s e " ,  
                         v i d e o W i d t h :   m o v i e W i d t h ,  
                         f l a s h W i d t h :   f l a s h W i d t h ,  
                         v i d e o H e i g h t :   m o v i e H e i g h t ,  
                         f l a s h H e i g h t :   f l a s h H e i g h t ,  
                         m a x V i d e o W i d t h :   f l a s h W i d t h  
                 } ;  
                 v a r   p a r a m s   =   {  
                         l o o p :   " t r u e " ,  
                         m e n u :   " t r u e " ,  
                         q u a l i t y :   " h i g h " ,  
                         s c a l e :   " n o s c a l e " ,  
                         s a l i g n :   " " ,  
                         w m o d e :   " w i n d o w " ,  
                         b g c o l o r :   " # 0 0 0 0 0 0 " ,  
                         b a s e :   " " ,  
                         s w l i v e c o n n e c t :   " " ,  
                         d e v i c e f o n t :   " f a l s e " ,  
                         a l l o w s c r i p t a c c e s s :   " s a m e D o m a i n " ,  
                         s e a m l e s s t a b b i n g :   " " ,  
                         a l l o w F u l l S c r e e n :   " t r u e " ,  
                         a l l o w n e t w o r k i n g :   " "  
                 } ;  
                 v a r   a t t r i b u t e s   =   {  
                         i d :   " v i d e o P l a y e r " ,  
                         n a m e :   " V i d e o P l a y e r " ,  
                         a l i g n :   " m i d d l e " ,  
                         s t y l e c l a s s :   " "  
                 } ;  
                 s w f o b j e c t . e m b e d S W F ( " / _ p l a y e r s / S i m p l e V i d e o P l a y e r . s w f " ,   t a r g e t E l e m e n t I d ,   f l a s h W i d t h ,   f l a s h H e i g h t ,   " 9 . 0 . 0 " ,   " / _ p l a y e r s / e x p r e s s I n s t a l l . s w f " ,   f l a s h v a r s ,   p a r a m s ,   a t t r i b u t e s ) ;  
         } ,  
  
         E m b e d S i m p l e A u d i o P l a y e r :   f u n c t i o n ( u r l ,   d u r a t i o n ,   b a c k g r o u n d ,   t a r g e t E l e m e n t I d )   {  
                 v a r   f l a s h v a r s   =   {  
                         j s E n a b l e d :   " t r u e " ,  
                         m p 3 U r l :   u r l ,  
                         m p 3 D u r a t i o n :   d u r a t i o n ,  
                         b a c k g r o u n d U r l :   b a c k g r o u n d  
                 } ;  
                 v a r   p a r a m s   =   {  
                         p l a y :   " f a l s e " ,  
                         l o o p :   " t r u e " ,  
                         m e n u :   " t r u e " ,  
                         q u a l i t y :   " h i g h " ,  
                         s c a l e :   " s h o w a l l " ,  
                         s a l i g n :   " " ,  
                         w m o d e :   " o p a q u e " ,  
                         b g c o l o r :   " # 0 0 0 0 0 0 " ,  
                         b a s e :   " " ,  
                         s w l i v e c o n n e c t :   " " ,  
                         d e v i c e f o n t :   " f a l s e " ,  
                         a l l o w S c r i p t A c c e s s :   " a l w a y s " ,  
                         s e a m l e s s t a b b i n g :   " " ,  
                         a l l o w F u l l S c r e e n :   " f a l s e " ,  
                         a l l o w n e t w o r k i n g :   " "  
                 } ;  
                 v a r   a t t r i b u t e s   =   {  
                         / / i d :   " s i m p l e A u d i o P l a y e r " ,  
                         n a m e :   " S i m p l e A u d i o P l a y e r " ,  
                         a l i g n :   " m i d d l e " ,  
                         s t y l e c l a s s :   " "  
                 } ;  
                 s w f o b j e c t . e m b e d S W F ( " / _ p l a y e r s / S i m p l e A u d i o P l a y e r . s w f " ,   t a r g e t E l e m e n t I d ,   " 1 5 5 " ,   " 3 0 " ,   " 9 . 0 . 0 " ,   " / _ p l a y e r s / e x p r e s s I n s t a l l . s w f " ,   f l a s h v a r s ,   p a r a m s ,   a t t r i b u t e s ) ;  
         } ,  
  
         E m b e d V i d e o P l a y e r :   f u n c t i o n ( u r l ,   p r e v 1 V i d e o T e a s e r I m a g e U r l ,   p r e v 2 V i d e o T e a s e r I m a g e U r l ,   n e x t 1 V i d e o T e a s e r I m a g e U r l ,   n e x t 2 V i d e o T e a s e r I m a g e U r l ,   p r e v 1 V i d e o I d ,   p r e v 2 V i d e o I d ,   n e x t 1 V i d e o I d ,   n e x t 2 V i d e o I d ,   b a c k g r o u n d ,   t a r g e t E l e m e n t I d ,   m a i n P a g e U r l ,   w i t h o u t L o g o ,   d i s a b l e A u t o P l a y )   {  
  
                 v a r   f l a s h v a r s   =   {  
                         j s E n a b l e d :   ' t r u e ' ,  
                         v i d e o U r l :   u r l ,  
                         p r e v V i d e o I d :   p r e v 2 V i d e o I d ,  
                         n e x t V i d e o I d :   n e x t 1 V i d e o I d ,  
                         b a c k g r o u n d U r l :   ' / p l a y e r s D a t a / b a c k g r o u n d C o l o r C o n t e s t H 4 0 0 . s w f ' ,  
                         a u t o P l a y :   " t r u e " ,  
                         l o g o R e d i r e c t U r l :   m a i n P a g e U r l  
                 } ;  
  
                 v a r   b g C o l o r   =   " # 0 0 0 0 0 0 " ;  
                 i f   ( w i t h o u t L o g o )   {  
                         v a r   b a c k g r o u n d U r l   =   ' / p l a y e r s D a t a / b a c k g r o u n d C o l o r C o n t e s t H 4 0 0 _ w i t h o u t L o g o t y p e . s w f ' ;  
                         i f   ( b a c k g r o u n d   = =   ' # F F F F F F ' )   {  
                                 b a c k g r o u n d U r l   =   ' / p l a y e r s D a t a / b a c k g r o u n d W h i t e C o n t e s t H 4 0 0 . s w f ' ;  
                                 b g C o l o r   =   b a c k g r o u n d ;  
                         }  
                         f l a s h v a r s   =   {  
                                 j s E n a b l e d :   ' t r u e ' ,  
                                 v i d e o U r l :   u r l ,  
                                 p r e v V i d e o I d :   p r e v 2 V i d e o I d ,  
                                 n e x t V i d e o I d :   n e x t 1 V i d e o I d ,  
                                 b a c k g r o u n d U r l :   b a c k g r o u n d U r l ,  
                                 a u t o P l a y :   " t r u e " ,  
                                 l o g o R e d i r e c t U r l :   m a i n P a g e U r l  
                         } ;  
                 }  
  
                 i f   ( d i s a b l e A u t o P l a y )  
                         f l a s h v a r s . a u t o P l a y   =   " f a l s e " ;  
                 v a r   p a r a m s   =   {  
                         l o o p :   " t r u e " ,  
                         m e n u :   " t r u e " ,  
                         q u a l i t y :   " h i g h " ,  
                         s c a l e :   " n o s c a l e " ,  
                         s a l i g n :   " " ,  
                         w m o d e :   " o p a q u e " ,  
                         b g c o l o r :   b g C o l o r ,  
                         b a s e :   " " ,  
                         s w l i v e c o n n e c t :   " " ,  
                         d e v i c e f o n t :   " f a l s e " ,  
                         a l l o w s c r i p t a c c e s s :   " s a m e D o m a i n " ,  
                         s e a m l e s s t a b b i n g :   " " ,  
                         a l l o w F u l l S c r e e n :   " t r u e " ,  
                         a l l o w n e t w o r k i n g :   " "  
                 } ;  
                 v a r   a t t r i b u t e s   =   {  
                         i d :   " v i d e o P l a y e r " ,  
                         n a m e :   " V i d e o P l a y e r " ,  
                         a l i g n :   " m i d d l e " ,  
                         s t y l e c l a s s :   " "  
                 } ;  
                 s w f o b j e c t . e m b e d S W F ( " / _ p l a y e r s / M u l t i V i d e o s P l a y e r . s w f " ,   t a r g e t E l e m e n t I d ,   " 9 7 0 " ,   " 4 0 0 " ,   " 9 . 0 . 0 " ,   " / _ p l a y e r s / e x p r e s s I n s t a l l . s w f " ,   f l a s h v a r s ,   p a r a m s ,   a t t r i b u t e s ) ;  
  
         } ,  
  
         E m b e d P r o j e c t o r P l a y e r :   f u n c t i o n ( p l a y l i s t U r l ,   u r l P a r a m P r o j e c t o r N a m e ,   u l r P a r a m L a n g ,   b a c k g r o u n d ,   t a r g e t E l e m e n t I d ,   m a i n P a g e U r l ,   w i t h o u t L o g o )   {  
                 v a r   f l a s h v a r s   =   {  
                         p l a y l i s t U r l :   p l a y l i s t U r l ,  
                         u r l P a r a m P r o j e c t o r N a m e :   u r l P a r a m P r o j e c t o r N a m e ,  
                         u l r P a r a m L a n g :   u l r P a r a m L a n g ,  
                         b a c k g r o u n d U r l :   ' / p l a y e r s D a t a / b a c k g r o u n d C o l o r C o n t e s t H 4 0 0 . s w f ' ,  
                         l o g o R e d i r e c t U r l :   m a i n P a g e U r l ,  
                         a u t o P l a y :   " f a l s e "  
                 } ;  
                 i f   ( w i t h o u t L o g o )   {  
                         f l a s h v a r s   =   {  
                                 p l a y l i s t U r l :   p l a y l i s t X m l ,  
                                 b a c k g r o u n d U r l :   ' / p l a y e r s D a t a / b a c k g r o u n d C o l o r C o n t e s t H 4 0 0 _ w i t h o u t L o g o t y p e . s w f ' ,  
                                 l o g o R e d i r e c t U r l :   m a i n P a g e U r l ,  
                                 a u t o P l a y :   " f a l s e "  
                         } ;  
                 }  
                 v a r   p a r a m s   =   {  
                         p l a y :   " t r u e " ,  
                         l o o p :   " t r u e " ,  
                         m e n u :   " t r u e " ,  
                         q u a l i t y :   " h i g h " ,  
                         s c a l e :   " s h o w a l l " ,  
                         s a l i g n :   " " ,  
                         w m o d e :   " o p a q u e " ,  
                         b g c o l o r :   " # 0 0 0 0 0 0 " ,  
                         b a s e :   " " ,  
                         s w l i v e c o n n e c t :   " " ,  
                         d e v i c e f o n t :   " f a l s e " ,  
                         a l l o w s c r i p t a c c e s s :   " s a m e D o m a i n " ,  
                         s e a m l e s s t a b b i n g :   " " ,  
                         a l l o w F u l l S c r e e n :   " t r u e " ,  
                         a l l o w n e t w o r k i n g :   " "  
                 } ;  
                 v a r   a t t r i b u t e s   =   {  
                         i d :   " p r o j e c t o r P l a y e r " ,  
                         n a m e :   " P r o j e c t o r P l a y e r " ,  
                         a l i g n :   " m i d d l e " ,  
                         s t y l e c l a s s :   " "  
                 } ;  
                 s w f o b j e c t . e m b e d S W F ( " / _ p l a y e r s / P r o j e c t o r P l a y e r . s w f " ,   t a r g e t E l e m e n t I d ,   " 9 7 0 " ,   " 4 0 0 " ,   " 9 . 0 . 0 " ,   " / _ p l a y e r s / e x p r e s s I n s t a l l . s w f " ,   f l a s h v a r s ,   p a r a m s ,   a t t r i b u t e s ) ;  
  
         } ,  
         S e a r c h F o c u s :   f u n c t i o n ( t e x t b o x I d ,   d e f a u l t T e x t )   {  
                 i f   ( $ ( " # "   +   t e x t b o x I d ) . v a l ( )   = =   d e f a u l t T e x t )  
                         $ ( " # "   +   t e x t b o x I d ) . v a l ( ' ' ) ;  
         } ,  
         S e a r c h B l u r :   f u n c t i o n ( t e x t b o x I d ,   s e a r c h T e x t )   {  
                 i f   ( $ ( " # "   +   t e x t b o x I d ) . v a l ( )   = =   ' ' )  
                         $ ( " # "   +   t e x t b o x I d ) . v a l ( s e a r c h T e x t ) ;  
         } ,  
         C l i e n t S e a r c h :   f u n c t i o n ( t e x t b o x I d ,   d e f a u l t T e x t )   {  
                 i f   ( $ ( " # "   +   t e x t b o x I d ) . v a l ( )   = =   d e f a u l t T e x t )  
                         r e t u r n   f a l s e ;  
                 e l s e  
                         r e t u r n   t r u e ;  
         } ,  
  
         P a u s e S i m p l e A u d i o P l a y e r :   f u n c t i o n ( s e l e c t e d M u s i c U r l ,   b e f o r e P l a y e d O b j e c t I d )   {  
                 v a r   b e f o r e   =   $ ( " # "   +   b e f o r e P l a y e d O b j e c t I d ) . v a l ( ) ;  
                 v a r   o b I d ;  
                 i f   ( b e f o r e   ! =   ' 0 ' )   {  
                         d o c u m e n t . g e t E l e m e n t B y I d ( b e f o r e ) . p a u s e ( ) ;  
                 }  
                 v a r   h d n I d   =   $ ( ' i n p u t : h i d d e n [ v a l u e = '   +   s e l e c t e d M u s i c U r l   +   ' ] ' ) . a t t r ( " i d " ) ;  
                 v a r   o b I d   =   h d n I d . r e p l a c e ( " h d M u s i c U r l " ,   " s A u d i o P l a y e r " ) ;  
                 $ ( " # "   +   b e f o r e P l a y e d O b j e c t I d ) . v a l ( o b I d ) ;  
         } ,  
  
         I n c r e m e n t M u s i c V i e w s C o u n t :   f u n c t i o n ( s e l e c t e d M u s i c U r l )   {  
                 v a r   u r l I d   =   $ ( ' i n p u t : h i d d e n [ v a l u e = '   +   s e l e c t e d M u s i c U r l   +   ' ] ' ) . a t t r ( " i d " ) ;  
                 v a r   m u s i c I d   =   $ ( ' # '   +   u r l I d . r e p l a c e ( " h d M u s i c U r l " ,   " h i d M u s i c I d " ) ) . v a l ( ) ;  
                 v a r   l b l I d   =   u r l I d . r e p l a c e ( " h d M u s i c U r l " ,   " l b l V i e w s C o u n t " ) ;  
                 M i l l i o n Y o u W S . T a g s S e r v i c e . I n c r e m e n t P l a y e d M u s i c ( m u s i c I d ,   l b l I d ,   t h i s . O n I n c r e m e n t M u s i c V i e w s C o u n t C o m p l e t e ) ;  
         } ,  
  
         O n I n c r e m e n t M u s i c V i e w s C o u n t C o m p l e t e :   f u n c t i o n ( a r g )   {  
                 $ ( ' # '   +   a r g [ 1 ] ) . t e x t ( a r g [ 0 ] ) ;  
         } ,  
  
         S h o w S k i l l s P o p u p :   f u n c t i o n ( i d )   {  
                 v a r   d i v S k i l l D a t a   =   $ ( " # "   +   i d ) ;  
                 d i v S k i l l D a t a . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
         } ,  
  
         H i d e S k i l l s P o p u p :   f u n c t i o n ( )   {  
                 v a r   d i v S k i l l D a t a   =   $ ( " . d i v S k i l l D a t a " ) ;  
                 d i v S k i l l D a t a . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
         } ,  
  
         S h o w C o n f i r m :   f u n c t i o n   ( b u t t o n I D ,   c o n f i r m T e x t ,   y e s T e x t ,   n o T e x t )   {  
                 v a r   b t n s   =   { } ;  
                 b t n s [ y e s T e x t ]   =   t r u e ;  
                 b t n s [ n o T e x t ]   =   f a l s e ;  
                 $ . p r o m p t ( c o n f i r m T e x t ,   {   c a l l b a c k :   f u n c t i o n   ( v ,   m ,   f )   {   i f   ( v )   {   $ ( " # "   +   b u t t o n I D ) . c l i c k ( ) ;   r e t u r n   t r u e ;   }   } ,   b u t t o n s :   b t n s ,   f o c u s :   1   } ) ;  
                 r e t u r n   f a l s e ;  
         }  
 }  
 M i l l i o n Y o u B a s e . r e g i s t e r C l a s s ( ' M i l l i o n Y o u B a s e ' ) ;  
  
 C t r l C o m m e n t s   =   f u n c t i o n ( c o n f i r m D e l e t e T e x t ,   c o n f i r m R e p o r t T e x t )   {  
         C t r l C o m m e n t s . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . c o n f i r m D e l e t e T e x t   =   c o n f i r m D e l e t e T e x t ;  
         t h i s . c o n f i r m R e p o r t T e x t   =   c o n f i r m R e p o r t T e x t ;  
 }  
  
 C t r l C o m m e n t s . p r o t o t y p e   =   {  
  
         s h o w E d i t M o d e :   f u n c t i o n ( e d i t M o d e I d ,   v i e w M o d e I d )   {  
                 $ ( ' # '   +   e d i t M o d e I d ) . s h o w ( ) ;  
                 $ ( ' # '   +   v i e w M o d e I d ) . h i d e ( ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         c a n c e l :   f u n c t i o n ( e d i t M o d e I d ,   v i e w M o d e I d )   {  
                 $ ( ' # '   +   e d i t M o d e I d ) . h i d e ( ) ;  
                 $ ( ' # '   +   v i e w M o d e I d ) . s h o w ( ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         c o n f i r m D e l e t e :   f u n c t i o n ( )   {  
                 r e t u r n   c o n f i r m ( t h i s . c o n f i r m D e l e t e T e x t )  
         } ,  
  
         c o n f i r m R e p o r t i n g :   f u n c t i o n ( )   {  
                 r e t u r n   c o n f i r m ( t h i s . c o n f i r m R e p o r t T e x t )  
         } ,  
  
         V a l i d a t e F c k E d i t o r :   f u n c t i o n ( f c k E d i t o r I d ,   f c k E r r o r S p a n I d )   {  
                 v a r   f c k V a l i d ;  
                 v a r   s t r F C K E d i t o r T e x t L e n g t h   =   t h i s . G e t F c k E d i t o r P l a i n T e x t L e n g t h ( f c k E d i t o r I d ) ;  
                 i f   ( s t r F C K E d i t o r T e x t L e n g t h   > =   2   & &   s t r F C K E d i t o r T e x t L e n g t h   < =   3 0 0 0 )   {  
                         f c k V a l i d   =   t r u e ;  
                         $ ( " # "   +   f c k E r r o r S p a n I d ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                 }  
                 e l s e   {  
                         $ ( " # "   +   f c k E r r o r S p a n I d ) . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
                         f c k V a l i d   =   f a l s e ;  
                 }  
                 r e t u r n   f c k V a l i d ;  
         }  
 }  
 C t r l C o m m e n t s . r e g i s t e r C l a s s ( ' C t r l C o m m e n t s ' ,   M i l l i o n Y o u B a s e ) ;    
  
 c t r l C u l t u r e S e l e c t o r   =   f u n c t i o n ( d i v L a n g u a g e s L i s t I d ,   i m g C u l t u r e M e n u R o l l D o w n I d ,   i m g C u l t u r e M e n u R o l l U p I d )   {  
         c t r l C u l t u r e S e l e c t o r . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . d i v L a n g u a g e s L i s t   =   " # "   +   d i v L a n g u a g e s L i s t I d ;  
         t h i s . i m g C u l t u r e M e n u R o l l D o w n   =   " # "   +   i m g C u l t u r e M e n u R o l l D o w n I d ;  
         t h i s . i m g C u l t u r e M e n u R o l l U p   =   " # "   +   i m g C u l t u r e M e n u R o l l U p I d ;  
 }  
 c t r l C u l t u r e S e l e c t o r . p r o t o t y p e   =   {  
  
         S h o w H i d e L i s t L a n g u a g e s :   f u n c t i o n ( )   {  
                 $ ( t h i s . d i v L a n g u a g e s L i s t ) . s l i d e T o g g l e ( " n o r m a l " ) ;  
                 $ ( t h i s . i m g C u l t u r e M e n u R o l l D o w n ) . t o g g l e ( ) ;  
                 $ ( t h i s . i m g C u l t u r e M e n u R o l l U p ) . t o g g l e ( ) ;  
         } ,  
  
         C h a n g e L a n g u a g e :   f u n c t i o n ( c u l t u r e C o d e )   {  
                 $ . c o o k i e ( ' S e l e c t e d C u l t u r e ' ,   c u l t u r e C o d e ,   {   e x p i r e s :   3 6 5 ,   p a t h :   ' / '   } ) ;  
                 l o c a t i o n . r e l o a d ( t r u e ) ;  
         }  
 }  
 c t r l C u l t u r e S e l e c t o r . r e g i s t e r C l a s s ( ' c t r l C u l t u r e S e l e c t o r ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l L o g i n I n d i c a t o r   =   f u n c t i o n   ( d i v P r o f i l e M e n u I d ,   i m g P r o f i l e M e n u R o l l D o w n I d ,   i m g P r o f i l e M e n u R o l l U p I d ,   d i v H e l p M e n u I d ,   i m g H e l p M e n u R o l l D o w n I d ,   i m g H e l p M e n u R o l l U p I d )   {  
         c t r l L o g i n I n d i c a t o r . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . d i v P r o f i l e M e n u   =   " # "   +   d i v P r o f i l e M e n u I d ;  
         t h i s . i m g P r o f i l e M e n u R o l l D o w n   =   " # "   +   i m g P r o f i l e M e n u R o l l D o w n I d ;  
         t h i s . i m g P r o f i l e M e n u R o l l U p   =   " # "   +   i m g P r o f i l e M e n u R o l l U p I d ;  
         t h i s . d i v H e l p M e n u   =   " # "   +   d i v H e l p M e n u I d ;  
         t h i s . i m g H e l p M e n u R o l l D o w n   =   " # "   +   i m g H e l p M e n u R o l l D o w n I d ;  
         t h i s . i m g H e l p M e n u R o l l U p   =   " # "   +   i m g H e l p M e n u R o l l U p I d ;  
 }  
 c t r l L o g i n I n d i c a t o r . p r o t o t y p e   =   {  
  
         R o l l P r o f i l e M e n u D o w n :   f u n c t i o n ( )   {  
                 $ ( t h i s . d i v P r o f i l e M e n u ) . s l i d e D o w n ( ' n o r m a l ' ) ;  
                 $ ( t h i s . i m g P r o f i l e M e n u R o l l D o w n ) . c s s ( " d i s p l a y " , " n o n e " ) ;  
                 $ ( t h i s . i m g P r o f i l e M e n u R o l l U p ) . c s s ( " d i s p l a y " , " i n l i n e " ) ;  
         } ,  
  
         R o l l P r o f i l e M e n u U p :   f u n c t i o n ( c u l t u r e C o d e )   {  
                 $ ( t h i s . d i v P r o f i l e M e n u ) . s l i d e U p ( ' n o r m a l ' ) ;  
                 $ ( t h i s . i m g P r o f i l e M e n u R o l l D o w n ) . c s s ( " d i s p l a y " , " i n l i n e " ) ;  
                 $ ( t h i s . i m g P r o f i l e M e n u R o l l U p ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
         } ,  
  
         R o l l H e l p M e n u D o w n :   f u n c t i o n ( )   {  
                 $ ( t h i s . d i v H e l p M e n u ) . s l i d e D o w n ( ' n o r m a l ' ) ;  
                 $ ( t h i s . i m g H e l p M e n u R o l l D o w n ) . c s s ( " d i s p l a y " , " n o n e " ) ;  
                 $ ( t h i s . i m g H e l p M e n u R o l l U p ) . c s s ( " d i s p l a y " , " i n l i n e " ) ;  
         } ,  
  
         R o l l H e l p M e n u U p :   f u n c t i o n ( )   {  
                 $ ( t h i s . d i v H e l p M e n u ) . s l i d e U p ( ' n o r m a l ' ) ;  
                 $ ( t h i s . i m g H e l p M e n u R o l l D o w n ) . c s s ( " d i s p l a y " , " i n l i n e " ) ;  
                 $ ( t h i s . i m g H e l p M e n u R o l l U p ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
         }  
 }  
 c t r l L o g i n I n d i c a t o r . r e g i s t e r C l a s s ( ' c t r l L o g i n I n d i c a t o r ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l C o n t e n t H e a d e r D a t a   =   f u n c t i o n ( c o m m e n t s P a n e l I d ,   s p a n S h o w D e t a i l s I d ,   s p a n H i d e D e t a i l s I d ,   s h o w D e t a i l s F u n c t i o n ,   d e t a i l s D i v C l i e n t I d )   {  
         c t r l C o n t e n t H e a d e r D a t a . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . c o m m e n t s P a n e l I d   =   " # "   +   c o m m e n t s P a n e l I d ;  
         t h i s . s p a n S h o w D e t a i l s   =   " # "   +   s p a n S h o w D e t a i l s I d ;  
         t h i s . s p a n H i d e D e t a i l s   =   " # "   +   s p a n H i d e D e t a i l s I d ;  
         t h i s . s h o w D e t a i l s F u n c t i o n   =   s h o w D e t a i l s F u n c t i o n ;  
         t h i s . d e t a i l s D i v C l i e n t   =   " # "   +   d e t a i l s D i v C l i e n t I d ;  
 }  
 c t r l C o n t e n t H e a d e r D a t a . p r o t o t y p e   =   {  
  
         G o T o C o m m e n t s :   f u n c t i o n ( )   {  
                 i f   ( $ ( t h i s . d e t a i l s D i v C l i e n t ) . c s s ( " d i s p l a y " )   = =   " n o n e " )   {  
                         e v a l ( t h i s . s h o w D e t a i l s F u n c t i o n ) ;  
                 }  
                 l o c a t i o n . h r e f   =   d o c u m e n t . U R L   +   t h i s . c o m m e n t s P a n e l I d ;  
         } ,  
         S h o w H i d e D e t a i l s :   f u n c t i o n ( )   {  
                 i f   ( $ ( t h i s . s p a n S h o w D e t a i l s ) . c s s ( " d i s p l a y " )   = =   " n o n e " )   {  
                         $ ( t h i s . s p a n S h o w D e t a i l s ) . c s s ( " d i s p l a y " ,   " i n l i n e " ) ;  
                         $ ( t h i s . s p a n H i d e D e t a i l s ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                 }  
                 e l s e   {  
                         $ ( t h i s . s p a n S h o w D e t a i l s ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                         $ ( t h i s . s p a n H i d e D e t a i l s ) . c s s ( " d i s p l a y " ,   " i n l i n e " ) ;  
                 }  
         }  
 }  
 c t r l C o n t e n t H e a d e r D a t a . r e g i s t e r C l a s s ( ' c t r l C o n t e n t H e a d e r D a t a ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l C o n t e n t C o w o r k e r s   =   f u n c t i o n ( t b x U r l I d ,   t b x E m b e d I d )   {  
         c t r l C o n t e n t C o w o r k e r s . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . t b x U r l   =   " # "   +   t b x U r l I d ;  
         t h i s . t b x E m b e d   =   " # "   +   t b x E m b e d I d ;          
 }  
 c t r l C o n t e n t C o w o r k e r s . p r o t o t y p e   =   {  
  
         U r l C l i c k :   f u n c t i o n ( )   {  
                 $ ( t h i s . t b x U r l ) . f o c u s ( ) ;  
                 $ ( t h i s . t b x U r l ) . s e l e c t ( ) ;  
         } ,  
         E m b e d C l i c k :   f u n c t i o n ( )   {  
                 $ ( t h i s . t b x E m b e d ) . f o c u s ( ) ;  
                 $ ( t h i s . t b x E m b e d ) . s e l e c t ( ) ;  
         }  
 }  
 c t r l C o n t e n t C o w o r k e r s . r e g i s t e r C l a s s ( ' c t r l C o n t e n t C o w o r k e r s ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l M u s i c D e t a i l s   =   f u n c t i o n ( d i v D e t a i l s I d )   {  
         c t r l M u s i c D e t a i l s . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . d i v D e t a i l s   =   " # "   +   d i v D e t a i l s I d ;  
 }  
 c t r l M u s i c D e t a i l s . p r o t o t y p e   =   {  
  
         S h o w H i d e D e t a i l s :   f u n c t i o n ( )   {  
                 $ ( t h i s . d i v D e t a i l s ) . s l i d e T o g g l e ( ' s l o w ' ) ;  
         }  
 }  
 c t r l M u s i c D e t a i l s . r e g i s t e r C l a s s ( ' c t r l M u s i c D e t a i l s ' ,   M i l l i o n Y o u B a s e ) ;  
 C o n t e n t S e l e c t o r   =   f u n c t i o n (  
         r b V i d e o I d ,  
         r b V i d e o M a i n C a t a l o g I d ,  
         r b V i d e o C o n t e s t I d ,  
         r b V i d e o M a r k e t I d ,  
         r b M u s i c I d ,  
         r b S c e n a r i o I d ,  
         h f E r r C h o o s e T y p e I d ,  
         h f E r r C h o o s e V i d e o T y p e I d ,  
         h f E r r C h o o s e C o n t e s t I d ,  
         d d l C o n t e s t I d ,  
         h f S e l e c t e d C o n t e s t I d ,  
         l t l E r r o r M e s s a g e I d )   {  
         C o n t e n t S e l e c t o r . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . r b V i d e o   =   " # "   +   r b V i d e o I d ;  
         t h i s . d d l C o n t e s t   =   " # "   +   d d l C o n t e s t I d ;  
         t h i s . h f S e l e c t e d C o n t e s t   =   " # "   +   h f S e l e c t e d C o n t e s t I d ;  
         t h i s . r b V i d e o M a i n C a t a l o g   =   " # "   +   r b V i d e o M a i n C a t a l o g I d ;  
         t h i s . r b V i d e o C o n t e s t   =   " # "   +   r b V i d e o C o n t e s t I d ;  
         t h i s . r b V i d e o M a r k e t   =   " # "   +   r b V i d e o M a r k e t I d ;  
         t h i s . r b M u s i c   =   " # "   +   r b M u s i c I d ;  
         t h i s . r b S c e n a r i o   =   " # "   +   r b S c e n a r i o I d ;  
         t h i s . h f E r r C h o o s e T y p e   =   " # "   +   h f E r r C h o o s e T y p e I d ;  
         t h i s . h f E r r C h o o s e V i d e o T y p e   =   " # "   +   h f E r r C h o o s e V i d e o T y p e I d ;  
         t h i s . h f E r r C h o o s e C o n t e s t   =   " # "   +   h f E r r C h o o s e C o n t e s t I d ;  
         t h i s . d d l C o n t e s t   =   " # "   +   d d l C o n t e s t I d ;  
         t h i s . h f S e l e c t e d C o n t e s t   =   " # "   +   h f S e l e c t e d C o n t e s t I d ;  
         t h i s . l t l E r r o r M e s s a g e   =   " # "   +   l t l E r r o r M e s s a g e I d ;  
 }  
 C o n t e n t S e l e c t o r . p r o t o t y p e   =   {  
  
         C h e c k V i d e o :   f u n c t i o n ( )   {  
                 i f   ( $ ( t h i s . r b V i d e o ) . a t t r ( " c h e c k e d " ) )   {  
                         $ ( " # d i v V i d e o R a d i o b u t t o n s " ) . s l i d e D o w n ( ) ;  
                 }  
                 e l s e   {  
                         $ ( " # d i v V i d e o R a d i o b u t t o n s " ) . s l i d e U p ( ) ;  
                 }  
         } ,  
  
         C h e c k C o n t e s t :   f u n c t i o n ( )   {  
                 i f   ( $ ( t h i s . r b V i d e o C o n t e s t ) . a t t r ( " c h e c k e d " ) )   {  
                         $ ( " # d i v C o n t e s t s " ) . s l i d e D o w n ( ) ;  
                 }  
                 e l s e   {  
                         $ ( " # d i v C o n t e s t s " ) . s l i d e U p ( ) ;  
                 }  
         } ,  
  
         C o n t e s t C h a n g e :   f u n c t i o n ( )   {  
                 $ ( t h i s . h f S e l e c t e d C o n t e s t ) . v a l ( $ ( t h i s . d d l C o n t e s t ) . v a l ( ) ) ;  
         } ,  
  
         V a l i d a t e :   f u n c t i o n ( )   {  
                 i f   ( ! $ ( t h i s . r b M u s i c ) . a t t r ( " c h e c k e d " )   & &   ! $ ( t h i s . r b S c e n a r i o ) . a t t r ( " c h e c k e d " )   & &   ! $ ( t h i s . r b V i d e o ) . a t t r ( " c h e c k e d " ) )   {  
                         $ ( t h i s . l t l E r r o r M e s s a g e ) . h t m l ( $ ( t h i s . h f E r r C h o o s e T y p e ) . v a l ( ) ) . f a d e I n ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 i f   ( $ ( t h i s . r b V i d e o ) . a t t r ( " c h e c k e d " )   & &   ! $ ( t h i s . r b V i d e o C o n t e s t ) . a t t r ( " c h e c k e d " )   & &   ! $ ( t h i s . r b V i d e o M a i n C a t a l o g ) . a t t r ( " c h e c k e d " )   & &   ! $ ( t h i s . r b V i d e o M a r k e t ) . a t t r ( " c h e c k e d " ) )   {  
                         $ ( t h i s . l t l E r r o r M e s s a g e ) . h t m l ( $ ( t h i s . h f E r r C h o o s e V i d e o T y p e ) . v a l ( ) ) . f a d e I n ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 i f   ( $ ( t h i s . r b V i d e o ) . a t t r ( " c h e c k e d " )   & &   $ ( t h i s . r b V i d e o C o n t e s t ) . a t t r ( " c h e c k e d " )   & &   $ ( t h i s . h f S e l e c t e d C o n t e s t ) . v a l ( )   <   0 )   {  
                         $ ( t h i s . l t l E r r o r M e s s a g e ) . h t m l ( $ ( t h i s . h f E r r C h o o s e C o n t e s t ) . v a l ( ) ) . f a d e I n ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( t h i s . l t l E r r o r M e s s a g e ) . h t m l ( " " ) . f a d e O u t ( ) ;  
                 r e t u r n   t r u e ;  
         }  
  
 }  
 C o n t e n t S e l e c t o r . r e g i s t e r C l a s s ( ' C o n t e n t S e l e c t o r ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l U s e r s S e a r c h e r   =   f u n c t i o n ( c u r r e n t C u l t u r e I d ,   t x t U s e r N a m e I d ,   s e x L a b e l ,   a g e L a b e l ,   c i t y L a b e l ,   a d d L a b e l ,   m a l e L a b e l ,   f e m a l e L a b e l ,   h f R o l e s J s o n I d ,   s e l e c t R o l e s L a b e l ,   d e l e t e L a b e l ,   h f R e s u l t s I d ,   a l r e a d y E x i s t s M e s s a g e ,   m i n i m u m O n e R o l e M e s s a g e ,   n e w P e r s o n L a b e l ,   n e w P e r s o n A d d I n f o L a b e l ,   n e w P e r s o n N a m e L a b e l ,   w r o n g U s e r N a m e L e n g t h M e s s a g e ,   h f I n c l u d e R o l e s I d ,   c l o s e L a b e l ,   a d d I m a g e U r l ,   d e l e t e I m a g e U r l ,   l o g g e d U s e r I d )   {  
         c t r l U s e r s S e a r c h e r . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . c u r r e n t C u l t u r e I d   =   c u r r e n t C u l t u r e I d ;  
         t h i s . l o g g e d U s e r I d   =   l o g g e d U s e r I d ;  
         t h i s . t x t U s e r N a m e   =   " # "   +   t x t U s e r N a m e I d ;  
         t h i s . m a l e L a b e l   =   m a l e L a b e l ;  
         t h i s . f e m a l e L a b e l   =   f e m a l e L a b e l ;  
         t h i s . s e x L a b e l   =   s e x L a b e l ;  
         t h i s . a g e L a b e l   =   a g e L a b e l ;  
         t h i s . c i t y L a b e l   =   c i t y L a b e l ;  
         t h i s . a l r e a d y E x i s t s M e s s a g e   =   a l r e a d y E x i s t s M e s s a g e ;  
         t h i s . m i n i m u m O n e R o l e M e s s a g e   =   m i n i m u m O n e R o l e M e s s a g e ;  
         t h i s . n e w P e r s o n L a b e l   =   n e w P e r s o n L a b e l ;  
         t h i s . n e w P e r s o n A d d I n f o L a b e l   =   n e w P e r s o n A d d I n f o L a b e l ;  
         t h i s . n e w P e r s o n N a m e L a b e l   =   n e w P e r s o n N a m e L a b e l ;  
         t h i s . w r o n g U s e r N a m e L e n g t h M e s s a g e   =   w r o n g U s e r N a m e L e n g t h M e s s a g e ;  
         / / T e m p a l t e   " o k n a "   z   w y n i k a m i   w y s z u k i w a n i a   u z y t k o w n i k o w  
         t h i s . u s e r L i s t C l o u d T e m p l a t e   =   " < d i v   i d = ' u s e r s C l o u d ' > < d i v   c l a s s = ' o n e C o l u m n   c l o s e B a r ' > < a   o n c l i c k = u s e r s S e a r c h e r . H i d e U s e r s L i s t ( ) > < i m g   s r c = ' _ i m g / b t n X . p n g '   a l t = ' "   +   c l o s e L a b e l   +   " '   / > < / a > < / d i v > { 0 } < d i v   i d = ' D i v U s e r s L i s t E r r o r '   c l a s s = ' o n e C o l u m n   v a l E r r '   s t y l e = ' d i s p l a y :   n o n e ; ' > < / d i v > < / d i v > "  
         / / T e m p l a t e   p o j e d y n c z e g o   e l e m e n t u   n a   l i s c i e   w y s z u k i w a n i a   u z y t k o w n i k o w  
         t h i s . s i n g l e U s e r T e m p l a t e   =   " < d i v   c l a s s = ' o n e C o l u m n   o n e U s e r ' > "   +  
                                                                     " < d i v   c l a s s = ' i m g ' > < i m g   s r c = ' { 0 } '   a l t = ' { 1 } '   / > < / d i v > "   +  
                                                                     " < d i v   c l a s s = ' d e t a i l s ' > "   +  
                                                                             " < d i v   c l a s s = ' u s e r N a m e ' > { 1 } < / d i v > "   +  
                                                                             " { 7 } "   +  
                                                                             " < d i v   c l a s s = ' a d d I n f o ' > { 2 } < / d i v > "   +  
                                                                             " < d i v   c l a s s = ' a d d I n f o ' > { 3 } < / d i v > "   +  
                                                                             " < d i v   c l a s s = ' a d d I n f o ' > { 4 } < / d i v > "   +  
                                                                             " < d i v   c l a s s = ' b t n ' > < a   o n c l i c k = ' u s e r s S e a r c h e r . A d d F r o m l i s t C l i c k ( { 5 } , { 6 } ) ' > < i m g   s r c = ' "   +   a d d I m a g e U r l   +   " '   a l t = ' "   +   a d d L a b e l   +   " '   / > < / a > < / d i v > "   +  
                                                                     " < / d i v > "   +  
                                                             " < / d i v > " ;  
         t h i s . n e w P e r s o n A d d I n f o T e m p l a t e   =   " < d i v   c l a s s = ' a d d I n f o ' > "   +   n e w P e r s o n A d d I n f o L a b e l   +   " < / d i v > " ;  
         / / T e m p l a t e   u z y t k o w n i k a   w y b r a n e g o   z   l i s t y   d l a   k t o r e g o   p o b i e r a n e   s a   r o l e  
         t h i s . s e l e c t e d U s e r T e m p l a t e   =   " < d i v   c l a s s = ' o n e C o l u m n   o n e U s e r ' > "   +  
                                                                         " < d i v   c l a s s = ' o n e L i n e ' > "   +  
                                                                                 " < d i v   c l a s s = ' i m g ' > < i m g   s r c = ' { 0 } '   a l t = ' { 1 } '   / > < / d i v > "   +  
                                                                                 " < d i v   c l a s s = ' d e t a i l s ' > "   +  
                                                                                         " < d i v   c l a s s = ' u s e r N a m e ' > { 1 } < / d i v > "   +  
                                                                                         " { 7 } "   +  
                                                                                         " < d i v   c l a s s = ' a d d I n f o ' > { 2 } < / d i v > "   +  
                                                                                         " < d i v   c l a s s = ' a d d I n f o ' > { 3 } < / d i v > "   +  
                                                                                         " < d i v   c l a s s = ' a d d I n f o ' > { 4 } < / d i v > "   +  
                                                                                 " < / d i v > "   +  
                                                                         " < / d i v > "   +  
                                                                         " < d i v   c l a s s = ' o n e L i n e   l a b e l ' > "   +   s e l e c t R o l e s L a b e l   +   " : < / d i v > "   +  
                                                                         " < d i v   i d = ' D i v R o l e s L i s t '   c l a s s = ' o n e L i n e   u s e r R o l e s ' > { 5 } < / d i v > "   +  
                                                                         " < d i v   i d = ' D i v S e l e c t e d U s e r E r r o r '   c l a s s = ' o n e C o l u m n   v a l E r r '   s t y l e = ' d i s p l a y :   n o n e ; ' > < / d i v > "   +  
                                                                         " < d i v   c l a s s = ' b t n ' > < a   o n c l i c k = ' u s e r s S e a r c h e r . F i n a l A d d C l i c k ( ) ' > < i m g   s r c = ' "   +   a d d I m a g e U r l   +   " '   a l t = ' "   +   a d d L a b e l   +   " '   / > < / a > < / d i v > "   +  
                                                                 " < / d i v > " ;  
         / / T e m p a l t e   t w o r z e n i a   n o w e g o   u z y t k o w n i k a   w r a z   z   r o l a m i  
         t h i s . s e l e c t e d N e w U s e r T e m p l a t e   =   " < d i v   c l a s s = ' o n e C o l u m n   o n e U s e r   n e w U s e r ' > "   +  
                                                                                 " < d i v   c l a s s = ' o n e L i n e ' > "   +  
                                                                                         " < d i v   c l a s s = ' i m g ' > < i m g   s r c = ' { 0 } '   a l t = ' { 1 } '   / > < / d i v > "   +  
                                                                                         " < d i v   c l a s s = ' d e t a i l s ' > "   +  
                                                                                                 " < d i v   c l a s s = ' u s e r N a m e ' > { 1 } < / d i v > "   +  
                                                                                                 " { 7 } "   +  
                                                                                                 " < d i v   c l a s s = ' a d d I n f o ' > { 2 } < / d i v > "   +  
                                                                                                 " < d i v   c l a s s = ' a d d I n f o ' > { 3 } < / d i v > "   +  
                                                                                                 " < d i v   c l a s s = ' a d d I n f o ' > { 4 } < / d i v > "   +  
                                                                                         " < / d i v > "   +  
                                                                                 " < / d i v > "   +  
                                                                                 " < d i v   c l a s s = ' o n e L i n e ' > "   +  
                                                                                         " < s p a n   c l a s s = ' l a b e l   l e f t F l o a t e d   r i g h t 2 0   t o p 4 ' > "   +   n e w P e r s o n N a m e L a b e l   +   " : < / s p a n > "   +  
                                                                                         " < i n p u t   t y p e = ' t e x t '   i d = ' t x t N e w U s e r N a m e '   n a m e = ' t x t N e w U s e r N a m e '   c l a s s = ' t x t W h i t e   l e f t F l o a t e d   t x t 3 0 0 '   / > "   +  
                                                                                 " < / d i v > "   +  
                                                                                 " < d i v   c l a s s = ' o n e L i n e   l a b e l ' > "   +   s e l e c t R o l e s L a b e l   +   " : < / d i v > "   +  
                                                                                 " < d i v   i d = ' D i v R o l e s L i s t '   c l a s s = ' o n e L i n e   u s e r R o l e s ' > { 5 } < / d i v > "   +  
                                                                                 " < d i v   i d = ' D i v S e l e c t e d U s e r E r r o r '   c l a s s = ' o n e C o l u m n   v a l E r r '   s t y l e = ' d i s p l a y :   n o n e ; ' > < / d i v > "   +  
                                                                                 " < d i v   c l a s s = ' b t n ' > < a   o n c l i c k = ' u s e r s S e a r c h e r . F i n a l A d d C l i c k ( ) ' > < i m g   s r c = ' "   +   a d d I m a g e U r l   +   " '   a l t = ' "   +   a d d L a b e l   +   " '   / > < / a > < / d i v > "   +  
                                                                       " < / d i v > " ;  
         / / T e m p a l t e   t w o r z e n i a   n o w e g o   u z y t k o w n i k a   b e z   r o l  
         t h i s . N e w U s e r W i t h o u t R o l e s T e m p l a t e   =   " < d i v   c l a s s = ' o n e C o l u m n   o n e U s e r   n e w U s e r ' > "   +  
                                                                                         " < d i v   c l a s s = ' o n e L i n e ' > "   +  
                                                                                                 " < s p a n   c l a s s = ' l a b e l   l e f t F l o a t e d   r i g h t 2 0   t o p 4 ' > "   +   n e w P e r s o n N a m e L a b e l   +   " : < / s p a n > "   +  
                                                                                                 " < i n p u t   t y p e = ' t e x t '   i d = ' t x t N e w U s e r N a m e '   c l a s s = ' t x t W h i t e   l e f t F l o a t e d   t x t 3 0 0 '   n a m e = ' t x t N e w U s e r N a m e ' / > "   +  
                                                                                         " < / d i v > "   +  
                                                                                         " < d i v   i d = ' D i v S e l e c t e d U s e r E r r o r '   c l a s s = ' o n e C o l u m n   v a l E r r '   s t y l e = ' d i s p l a y :   n o n e ; ' > < / d i v > "   +  
                                                                                         " < d i v   c l a s s = ' b t n ' > < a   o n c l i c k = ' u s e r s S e a r c h e r . F i n a l A d d C l i c k ( ) ' > < i m g   s r c = ' "   +   a d d I m a g e U r l   +   " '   a l t = ' "   +   a d d L a b e l   +   " '   / > < / a > < / d i v > "   +  
                                                                                 " < / d i v > " ;  
         / / T e m p l a t e   p o j e d y n c z e g o   c h e c k b o x a   z   r o l a  
         t h i s . r o l e C h e c k b o x T e m p l a t e   =   " < d i v   c l a s s = ' o n e R o l e   c h b ' > < i n p u t   i d = ' { 0 } '   t y p e = ' c h e c k b o x '   v a l u e = ' { 2 } '   o n c l i c k = \ " u s e r s S e a r c h e r . R o l e C l i c k ( { 2 } , { 3 } , ' { 0 } ' ) \ "   n a m e = ' c t l 0 0 $ c p h M a i n $ u s e r s S e a r c h e r $ c b 1 '   / > < l a b e l   f o r = ' { 0 } ' > { 1 } < / l a b e l > < / d i v > " ;  
         t h i s . r o l e S e p a r a t o r T e m p l a t e   =   " < d i v   c l a s s = ' c l e a r ' > & n b s p ; < / d i v > < d i v   c l a s s = ' n o F l o a t ' > & n b s p ; < / d i v > " ;  
         / / T e m p l a t e   p o j e d y c z n e g o   e l e m e n t u   n a   l i s c i e   j u z   w y b r a n y c h   u z y t k o w n i k o w  
         t h i s . u s e r W i t h R o l e s T e m p l a t e   =   " < d i v   c l a s s = ' o n e C o l u m n   o n e U s e r ' > "   +  
                                                                         " < d i v   c l a s s = ' i m g ' > < i m g   s r c = ' { 0 } '   a l t = ' { 1 } '   / > < / d i v > "   +  
                                                                         " < d i v   c l a s s = ' d e t a i l s ' > "   +  
                                                                                 " < d i v   c l a s s = ' u s e r N a m e ' > { 1 } < / d i v > "   +  
                                                                                 " < d i v   c l a s s = ' a d d I n f o ' > { 2 } < / d i v > "   +  
                                                                                 " < d i v   c l a s s = ' b t n ' > < a   o n c l i c k = ' u s e r s S e a r c h e r . D e l e t e S e l e c t e d U s e r ( { 3 } ) ' > < i m g   s r c = ' "   +   d e l e t e I m a g e U r l   +   " '   a l t = ' "   +   d e l e t e L a b e l   +   " '   / > < / a > < / d i v > "   +  
                                                                         " < / d i v > "   +  
                                                                   " < / d i v > " ;  
         t h i s . r e s u l t L i s t ;  
         t h i s . h f I n c l u d e R o l e s   =   " # "   +   h f I n c l u d e R o l e s I d ;  
         t h i s . s e l e c t e d R e s u l t s   =   n e w   A r r a y ( ) ;  
         t h i s . h f R o l e s J s o n   =   " # "   +   h f R o l e s J s o n I d ;  
         t h i s . a l l R o l e s   =   e v a l ( $ ( t h i s . h f R o l e s J s o n ) . v a l ( ) ) ;  
         t h i s . s e l e c t e d S i n g l e R e s u l t ;  
         t h i s . h f R e s u l t s   =   " # "   +   h f R e s u l t s I d ;  
 }  
 c t r l U s e r s S e a r c h e r . p r o t o t y p e   =   {  
  
         / / P r z e s y l a   z a d a n i e   d o   W S  
         S e a r c h U s e r s :   f u n c t i o n ( )   {  
                 / / $ ( ' # d i v U s e r S e l e c t o r T x t ' ) . r e m o v e C l a s s ( ' b o x C o n t e n t G r a y ' ) . a d d C l a s s ( ' b o x C o n t e n t D a r k G r a y ' ) ;  
                 $ ( ' # d i v U s e r S e l e c t o r ,   # d i v U s e r S e l e c t o r   . b o x C o n t e n t G r a y W i t h o u t P a d d i n g ' ) . r e m o v e C l a s s ( ' b o x C o n t e n t G r a y W i t h o u t P a d d i n g ' ) . a d d C l a s s ( ' b o x C o n t e n t D a r k G r a y W i t h o u t P a d d i n g ' ) ;  
                 $ ( ' # d i v U s e r S e l e c t o r ,   # d i v U s e r S e l e c t o r   . b o x C o n t e n t G r a y ' ) . r e m o v e C l a s s ( ' b o x C o n t e n t G r a y ' ) . a d d C l a s s ( ' b o x C o n t e n t D a r k G r a y ' ) ;  
                 M i l l i o n Y o u W S . T a g s S e r v i c e . S e a r c h U s e r s ( $ ( t h i s . t x t U s e r N a m e ) . v a l ( ) ,   t h i s . l o g g e d U s e r I d ,   t h i s . c u r r e n t C u l t u r e I d ,   t h i s . B u i l d s U s e r s L i s t ,   t h i s . O n W s E r r o r ,   t h i s ) ;  
         } ,  
  
         / / C a l l b a c k   z   W S   -   b u d u j e   l i s t e   w y n i k o w  
         B u i l d s U s e r s L i s t :   f u n c t i o n ( r e s u l t ,   u s e r C o n t e x t )   {  
                 v a r   o u t p u t H t m l   =   ' ' ;  
                 i f   ( r e s u l t   ! =   n u l l )   {  
                         i f   ( r e s u l t . l e n g t h   = =   0 )   {  
                                 u s e r C o n t e x t . H i d e U s e r s L i s t ( ) ;  
                                 r e t u r n ;  
                         }  
                         u s e r C o n t e x t . r e s u l t L i s t   =   r e s u l t ;  
                         f o r   ( v a r   i   =   0 ;   i   <   r e s u l t . l e n g t h ;   i + + )   {  
                                 v a r   s i n g l e I t e m   =   u s e r C o n t e x t . s i n g l e U s e r T e m p l a t e ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 0 } ' ,   r e s u l t [ i ] . A v a t a r P a t h ) ;  
                                 i f   ( r e s u l t [ i ] . I d   >   0 )   {  
                                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / \ { 1 \ } / g ,   r e s u l t [ i ] . D i s p l a y N a m e ) ;   / / r e s u l t [ i ] . F i r s t N a m e   +   "   "   +   r e s u l t [ i ] . L a s t N a m e ) ;  
                                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 7 } ' ,   ' ' ) ;  
                                 }  
                                 e l s e   {  
                                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / \ { 1 \ } / g ,   u s e r C o n t e x t . n e w P e r s o n L a b e l ) ;  
                                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 7 } ' ,   u s e r C o n t e x t . n e w P e r s o n A d d I n f o T e m p l a t e ) ;  
                                 }  
                                 i f   ( r e s u l t [ i ] . I s M a l e   ! =   n u l l )  
                                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 2 } ' ,   u s e r C o n t e x t . s e x L a b e l   +   " :   "   +   ( r e s u l t [ i ] . I s M a l e   ?   u s e r C o n t e x t . m a l e L a b e l   :   u s e r C o n t e x t . f e m a l e L a b e l ) ) ;  
                                 e l s e  
                                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 2 } ' ,   ' ' ) ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 3 } ' ,   r e s u l t [ i ] . A g e   = =   n u l l   ?   ' '   :   u s e r C o n t e x t . a g e L a b e l   +   " :   "   +   r e s u l t [ i ] . A g e ) ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 4 } ' ,   r e s u l t [ i ] . C i t y   = =   ' '   | |   r e s u l t [ i ] . C i t y   = =   n u l l   ?   ' '   :   u s e r C o n t e x t . c i t y L a b e l   +   " :   "   +   r e s u l t [ i ] . C i t y ) ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 5 } ' ,   r e s u l t [ i ] . I d ) ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 6 } ' ,   i ) ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / < d i v   c l a s s = ' a d d I n f o ' > < \ / d i v > / g ,   ' ' ) ;  
                                 o u t p u t H t m l   + =   s i n g l e I t e m ;  
                         }  
                         o u t p u t H t m l   =   u s e r C o n t e x t . u s e r L i s t C l o u d T e m p l a t e . r e p l a c e ( ' { 0 } ' ,   o u t p u t H t m l ) ;  
                         v a r   d e s t i n a t i o n D i v   =   $ ( " # d i v U s e r s R e s u l t s " ) ;  
                         d e s t i n a t i o n D i v . h t m l ( o u t p u t H t m l ) . s l i d e D o w n ( ) ;  
                 }  
         } ,  
  
         / / C a l l b a c k   z   b l e d e m   W S  
         O n W s E r r o r :   f u n c t i o n ( u s e r C o n t e x t )   {  
  
         } ,  
  
         / / A k c j a   d o d a n i a   u z y t k o w n i k a   z   l i s t y   z w r o c o n e j   p r z e z   W S  
         / / J e s l i   j e s t   t o   n o w y   u z y t k o w n i k   l u b   p o b i e r a m y   d o d a t k o w o   r o l e   u z y t k o w n i k o w   w y s w i e t l a n a   j e s t   d o d a t k o w y   d i v  
         A d d F r o m l i s t C l i c k :   f u n c t i o n ( u s e r I d ,   u s e r I n d e x )   {  
                 i f   ( u s e r s S e a r c h e r . I s S e l e c t e d U s e r ( u s e r I d ) )   {  
                         $ ( " # D i v U s e r s L i s t E r r o r " ) . h t m l ( u s e r s S e a r c h e r . a l r e a d y E x i s t s M e s s a g e ) . s h o w ( ) ;  
                         w i n d o w . s c r o l l T o ( 0 ,   $ ( " # D i v U s e r s L i s t E r r o r " ) . o f f s e t ( ) . t o p ) ;  
                         r e t u r n ;  
                 }  
                 u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t   =   u s e r I n d e x ;  
                 / / J e z e l i   d o l a c z a m y   r o l e   u z y t k o w n i k o w  
                 i f   ( $ ( u s e r s S e a r c h e r . h f I n c l u d e R o l e s ) . v a l ( )   = =   " T r u e " )   {  
                         v a r   o u t p u t H t m l   =   ' ' ;  
                         v a r   s i n g l e I t e m   =   u s e r I d   >   0   ?   u s e r s S e a r c h e r . s e l e c t e d U s e r T e m p l a t e   :   u s e r s S e a r c h e r . s e l e c t e d N e w U s e r T e m p l a t e ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 0 } ' ,   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . A v a t a r P a t h ) ;  
                         i f   ( u s e r I d   >   0 )   {  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / \ { 1 \ } / g ,   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . D i s p l a y N a m e ) ;   / / u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . F i r s t N a m e   +   "   "   +   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . L a s t N a m e ) ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 7 } ' ,   ' ' ) ;  
                         }  
                         e l s e   {  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / \ { 1 \ } / g ,   u s e r s S e a r c h e r . n e w P e r s o n L a b e l ) ;  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 7 } ' ,   u s e r s S e a r c h e r . n e w P e r s o n A d d I n f o T e m p l a t e ) ;  
                         }  
                         i f   ( u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . I s M a l e   ! =   n u l l )  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 2 } ' ,   u s e r s S e a r c h e r . s e x L a b e l   +   " :   "   +   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . I s M a l e   ?   u s e r s S e a r c h e r . m a l e L a b e l   :   u s e r s S e a r c h e r . f e m a l e L a b e l ) ;  
                         e l s e  
                                 s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 2 } ' ,   ' ' ) ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 3 } ' ,   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . A g e   = =   n u l l   ?   ' '   :   u s e r s S e a r c h e r . a g e L a b e l   +   " :   "   +   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . A g e ) ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 4 } ' ,   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . C i t y   = =   ' '   | |   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . C i t y   = =   n u l l   ?   ' '   :   u s e r s S e a r c h e r . c i t y L a b e l   +   " :   "   +   u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r I n d e x ] . C i t y ) ;  
  
                         v a r   r o l e s   =   ' ' ;  
                         u s e r s S e a r c h e r . a l l R o l e s   =   e v a l ( $ ( u s e r s S e a r c h e r . h f R o l e s J s o n ) . v a l ( ) ) ;  
                         f o r   ( v a r   i   =   0 ;   i   <   u s e r s S e a r c h e r . a l l R o l e s . l e n g t h ;   i + + )   {  
                                 v a r   s i n g l e R o l e   =   u s e r s S e a r c h e r . r o l e C h e c k b o x T e m p l a t e ;  
                                 v a r   i d   =   " c b U s e r R o l e "   +   u s e r s S e a r c h e r . a l l R o l e s [ i ] . R o l e I d ;  
                                 s i n g l e R o l e   =   s i n g l e R o l e . r e p l a c e ( n e w   R e g E x p ( ' ( \ { 0 \ \ } ) ' ,   " g " ) ,   i d ) ;  
                                 s i n g l e R o l e   =   s i n g l e R o l e . r e p l a c e ( ' { 1 } ' ,   u s e r s S e a r c h e r . a l l R o l e s [ i ] . R o l e N a m e ) ;  
                                 s i n g l e R o l e   =   s i n g l e R o l e . r e p l a c e ( n e w   R e g E x p ( ' ( \ { 2 \ \ } ) ' ,   " g " ) ,   u s e r s S e a r c h e r . a l l R o l e s [ i ] . R o l e I d ) ;  
                                 s i n g l e R o l e   =   s i n g l e R o l e . r e p l a c e ( ' { 3 } ' ,   i ) ;  
                                 r o l e s   + =   s i n g l e R o l e ;  
                                 i f   ( ( i   ! =   0 )   & &   ( i   ! =   u s e r s S e a r c h e r . a l l R o l e s . l e n g t h   -   1 )   & &   ( i   %   3   = =   2 ) )  
                                         r o l e s   + =   u s e r s S e a r c h e r . r o l e S e p a r a t o r T e m p l a t e ;  
                         }  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 5 } ' ,   r o l e s ) ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / < d i v   c l a s s = ' a d d I n f o ' > < \ / d i v > / g ,   ' ' ) ;  
                         o u t p u t H t m l   + =   s i n g l e I t e m ;  
                         o u t p u t H t m l   =   u s e r s S e a r c h e r . u s e r L i s t C l o u d T e m p l a t e . r e p l a c e ( ' { 0 } ' ,   o u t p u t H t m l ) ;  
                         u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t ] . R o l e s   =   n e w   A r r a y ( ) ;  
                         v a r   d e s t i n a t i o n D i v   =   $ ( " # d i v U s e r s R e s u l t s " ) ;  
                         d e s t i n a t i o n D i v . h t m l ( o u t p u t H t m l ) . s l i d e D o w n ( ) ;  
                 }  
                 e l s e   {  
                         i f   ( u s e r I d   >   0 )   {  
                                 u s e r s S e a r c h e r . F i n a l A d d C l i c k ( ) ;  
                         }  
                         e l s e   {  
                                 v a r   o u t p u t H t m l   =   u s e r s S e a r c h e r . u s e r L i s t C l o u d T e m p l a t e . r e p l a c e ( ' { 0 } ' ,   u s e r s S e a r c h e r . N e w U s e r W i t h o u t R o l e s T e m p l a t e ) ;  
                                 $ ( " # d i v U s e r s R e s u l t s " ) . h t m l ( o u t p u t H t m l ) . s l i d e D o w n ( ) ;  
                         }  
                 }  
         } ,  
  
         / / C h o w a   d i v a   z   w y n i k a m i   w y s z u k i w a n i a   z   W S  
         H i d e U s e r s L i s t :   f u n c t i o n ( )   {  
                 $ ( " # u s e r s C l o u d " ) . h i d e ( ) ;  
                 $ ( ' # d i v U s e r s R e s u l t s ' ) . s l i d e U p ( ) ;  
                 $ ( ' # d i v U s e r S e l e c t o r ,   # d i v U s e r S e l e c t o r   . b o x C o n t e n t D a r k G r a y W i t h o u t P a d d i n g ' ) . r e m o v e C l a s s ( ' b o x C o n t e n t D a r k G r a y W i t h o u t P a d d i n g ' ) . a d d C l a s s ( ' b o x C o n t e n t G r a y W i t h o u t P a d d i n g ' ) ;  
                 $ ( ' # d i v U s e r S e l e c t o r ,   # d i v U s e r S e l e c t o r   . b o x C o n t e n t D a r k G r a y ' ) . r e m o v e C l a s s ( ' b o x C o n t e n t D a r k G r a y ' ) . a d d C l a s s ( ' b o x C o n t e n t G r a y ' ) ;  
         } ,  
  
         / / D o d a j e   u z y t k o w n i k a   d o   l i s t y   w y b r a n y c h  
         F i n a l A d d C l i c k :   f u n c t i o n ( )   {  
                 i f   ( $ ( u s e r s S e a r c h e r . h f I n c l u d e R o l e s ) . v a l ( )   = =   " T r u e " )   {  
                         i f   ( u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t ] . R o l e s . l e n g t h   = =   0 )   {  
                                 $ ( " # D i v S e l e c t e d U s e r E r r o r " ) . h t m l ( u s e r s S e a r c h e r . m i n i m u m O n e R o l e M e s s a g e ) . s h o w ( ) ;  
                                 r e t u r n ;  
                         }  
                 }  
                 i f   ( u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t ] . I d   <   0 )   {  
                         v a r   u s e r N a m e   =   $ ( " # t x t N e w U s e r N a m e " ) . v a l ( ) ;  
                         i f   ( u s e r N a m e   = =   ' ' )   {  
                                 $ ( " # D i v S e l e c t e d U s e r E r r o r " ) . h t m l ( u s e r s S e a r c h e r . w r o n g U s e r N a m e L e n g t h M e s s a g e ) . s h o w ( ) ;  
                                 r e t u r n ;  
                         }  
                         i f   ( u s e r s S e a r c h e r . E x i s t s U s e r N a m e ( u s e r N a m e ) )   {  
                                 $ ( " # D i v S e l e c t e d U s e r E r r o r " ) . h t m l ( u s e r s S e a r c h e r . a l r e a d y E x i s t s M e s s a g e ) . s h o w ( ) ;  
                                 r e t u r n ;  
                         }  
                         u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t ] . D i s p l a y N a m e   =   u s e r N a m e ;   / / . F i r s t N a m e   =   u s e r N a m e ;  
                 }  
                 u s e r s S e a r c h e r . s e l e c t e d R e s u l t s . p u s h ( u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t ] ) ;  
                 u s e r s S e a r c h e r . B u i l d S e l e c t e d U s e r s L i s t ( ) ;  
                 u s e r s S e a r c h e r . H i d e U s e r s L i s t ( ) ;  
         } ,  
  
         / / S p r a w d z a   c z y   d a n a   n a z w a   u z y t k o w n i k a   j e s t   j u z   n a   l i s c i e   w y n i k o w  
         E x i s t s U s e r N a m e :   f u n c t i o n ( u s e r N a m e )   {  
                 f o r   ( v a r   i   =   0 ;   i   <   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s . l e n g t h ;   i + + )   {  
                         / / i f   ( u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . F i r s t N a m e . t o L o w e r C a s e ( )   = =   u s e r N a m e . t o L o w e r C a s e ( ) )  
                         i f   ( u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . D i s p l a y N a m e . t o L o w e r C a s e ( )   = =   u s e r N a m e . t o L o w e r C a s e ( ) )  
                                 r e t u r n   t r u e ;  
                 }  
                 r e t u r n   f a l s e ;  
         } ,  
  
         / / A k c j a   k l i k n i e c i a   n a   r o l e   -   d o d a j e   l u b   u s u w a   w y b r a n a   r o l e   d o / z   a k t u a l n e g o   u z y t k o w n i k a  
         R o l e C l i c k :   f u n c t i o n ( r o l e I d ,   r o l e I n d e x ,   c h e c k b o x I d )   {  
                 i f   ( $ ( " # "   +   S t r i n g ( c h e c k b o x I d ) ) . a t t r ( ' c h e c k e d ' ) )   {  
                         u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t ] . R o l e s . p u s h ( u s e r s S e a r c h e r . a l l R o l e s [ r o l e I n d e x ] ) ;  
                 }  
                 e l s e   {  
                         u s e r s S e a r c h e r . r e s u l t L i s t [ u s e r s S e a r c h e r . s e l e c t e d S i n g l e R e s u l t ] . R o l e s . p o p ( u s e r s S e a r c h e r . a l l R o l e s [ r o l e I n d e x ] ) ;  
                 }  
         } ,  
  
         / / B u d u j e   l i s t e   a k t u a l n i e   w y b r a n y c h   u z y t k o w n i k o w  
         B u i l d S e l e c t e d U s e r s L i s t :   f u n c t i o n ( )   {  
                 v a r   o u t p u t H t m l   =   ' ' ;  
                 i f   ( u s e r s S e a r c h e r . s e l e c t e d R e s u l t s . l e n g t h   = =   0 )   {  
                         $ ( " # d i v S e l e c t e d U s e r s L i s t " ) . s l i d e U p ( ) ;  
                         r e t u r n ;  
                 }  
                 f o r   ( v a r   i   =   0 ;   i   <   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s . l e n g t h ;   i + + )   {  
                         v a r   s i n g l e I t e m   =   u s e r s S e a r c h e r . u s e r W i t h R o l e s T e m p l a t e ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 0 } ' ,   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . A v a t a r P a t h ) ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / \ { 1 \ } / g ,   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . D i s p l a y N a m e ) ;   / / u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . F i r s t N a m e   +   "   "   +   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . L a s t N a m e ) ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 3 } ' ,   i ) ;  
                         v a r   r o l e s   =   ' ' ;  
                         i f   ( $ ( u s e r s S e a r c h e r . h f I n c l u d e R o l e s ) . v a l ( )   = =   " T r u e " )   {  
                                 f o r   ( v a r   j   =   0 ;   j   <   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . R o l e s . l e n g t h ;   j + + )   {  
                                         r o l e s   + =   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . R o l e s [ j ] . R o l e N a m e . t o L o w e r C a s e ( ) ;  
                                         i f   ( j   <   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . R o l e s . l e n g t h   -   1 )  
                                                 r o l e s   + =   " ,   " ;  
                                 }  
                         }  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( ' { 2 } ' ,   r o l e s ) ;  
                         s i n g l e I t e m   =   s i n g l e I t e m . r e p l a c e ( / < d i v   c l a s s = ' a d d I n f o ' > < \ / d i v > / g ,   ' ' ) ;  
                         o u t p u t H t m l   + =   s i n g l e I t e m ;  
                 }  
                 $ ( t h i s . h f R e s u l t s ) . v a l ( t o J s o n S t r i n g ( u s e r s S e a r c h e r . s e l e c t e d R e s u l t s ) ) ;  
                 v a r   d e s t i n a t i o n D i v   =   $ ( " # d i v S e l e c t e d U s e r s L i s t " ) . s l i d e D o w n ( ) ;  
                 d e s t i n a t i o n D i v . h t m l ( o u t p u t H t m l ) ;  
         } ,  
  
         / / U s u w a   w y b r a n e g o   u z y t k o w n i k a   z   l i s t y  
         D e l e t e S e l e c t e d U s e r :   f u n c t i o n ( i n d e x )   {  
                 u s e r s S e a r c h e r . s e l e c t e d R e s u l t s . s p l i c e ( i n d e x ,   1 ) ;  
                 u s e r s S e a r c h e r . B u i l d S e l e c t e d U s e r s L i s t ( ) ;  
         } ,  
  
         / / S p r a w d z a   c z y   u s e r   o   d a n y m   I D   j u z   j e s t   n a   l i s c i e  
         I s S e l e c t e d U s e r :   f u n c t i o n ( u s e r I d )   {  
                 i f   ( u s e r I d   < =   0 )  
                         r e t u r n   f a l s e ;  
                 f o r   ( v a r   i   =   0 ;   i   <   u s e r s S e a r c h e r . s e l e c t e d R e s u l t s . l e n g t h ;   i + + )   {  
                         i f   ( u s e r s S e a r c h e r . s e l e c t e d R e s u l t s [ i ] . I d   = =   u s e r I d )  
                                 r e t u r n   t r u e ;  
                 }  
                 r e t u r n   f a l s e ;  
         } ,  
  
         / / P o b i e r a   z   h i d d e n a   i   u s t a w i a   l i s t e   w y b r a n y c h   u z y t k o w n i k o w  
         S e t S e l e c t e d U s e r s :   f u n c t i o n ( )   {  
                 v a r   r e s u l t s   =   $ ( u s e r s S e a r c h e r . h f R e s u l t s ) . v a l ( ) ;  
                 i f   ( r e s u l t s   ! =   ' ' )   {  
                         u s e r s S e a r c h e r . s e l e c t e d R e s u l t s   =   e v a l ( r e s u l t s ) ;  
                         u s e r s S e a r c h e r . B u i l d S e l e c t e d U s e r s L i s t ( ) ;  
                 }  
         }  
  
 }  
 c t r l U s e r s S e a r c h e r . r e g i s t e r C l a s s ( ' c t r l U s e r s S e a r c h e r ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l T a g s L i s t   =   f u n c t i o n ( )  
 {  
         c t r l T a g s L i s t . i n i t i a l i z e B a s e ( t h i s ) ;  
 }  
 c t r l T a g s L i s t . p r o t o t y p e   =   {  
  
         V a l i d a t e T a g s :   f u n c t i o n ( m i n T a g s C o u n t )   {  
                 v a r   t a g s C o u n t   =   0 ;  
                 $ ( " . t x t _ t a g " ) . e a c h ( f u n c t i o n ( )   {   i f   ( $ ( t h i s ) . v a l ( )   ! =   ' ' )   t a g s C o u n t + + ;   } ) ;  
                 r e t u r n   t a g s C o u n t   > =   m i n T a g s C o u n t ;  
         }  
  
 }  
 c t r l T a g s L i s t . r e g i s t e r C l a s s ( ' c t r l T a g s L i s t ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l A d v e r t i s e m e n t C a t e g o r i e s S e l e c t o r   =   f u n c t i o n ( d d l A c t u a l C o n t e s t s I d ,   d i v C a t e g o r i e s I d ,   a c t u a l C o n t e s t C h e c k b o x I d )   {  
         c t r l A d v e r t i s e m e n t C a t e g o r i e s S e l e c t o r . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . d d l A c t u a l C o n t e s t s   =   " # "   +   d d l A c t u a l C o n t e s t s I d ;  
         t h i s . d i v C a t e g o r i e s   =   " # "   +   d i v C a t e g o r i e s I d ;  
         t h i s . a c t u a l C o n t e s t C h e c k b o x   =   " # "   +   a c t u a l C o n t e s t C h e c k b o x I d ;  
 }  
  
 c t r l A d v e r t i s e m e n t C a t e g o r i e s S e l e c t o r . p r o t o t y p e   =   {  
  
         T o g g l e C o n t e s t s D r o p D o w n :   f u n c t i o n ( c b x A c t u a l C o n t e s t I d )   {  
                 i f   ( $ ( " # "   +   c b x A c t u a l C o n t e s t I d ) . a t t r ( " c h e c k e d " ) )  
                         $ ( t h i s . d d l A c t u a l C o n t e s t s ) . r e m o v e A t t r ( " d i s a b l e d " ) ;  
                 e l s e  
                         $ ( t h i s . d d l A c t u a l C o n t e s t s ) . a t t r ( " d i s a b l e d " ,   " d i s a b l e d " ) ;  
         } ,  
         V a l i d a t e A c t u a l C o n t e s t s :   f u n c t i o n ( s e n d e r ,   a r g s )   {  
                 i f   ( $ ( t h i s . a c t u a l C o n t e s t C h e c k b o x ) . a t t r ( " c h e c k e d " ) )   {  
                         a r g s . I s V a l i d   =   $ ( t h i s . d d l A c t u a l C o n t e s t s ) . v a l ( )   ! =   0 ;  
                 }  
                 e l s e  
                         a r g s . I s V a l i d   =   t r u e ;  
         }  
 }  
 c t r l A d v e r t i s e m e n t C a t e g o r i e s S e l e c t o r . r e g i s t e r C l a s s ( ' c t r l A d v e r t i s e m e n t C a t e g o r i e s S e l e c t o r ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l A d v e r t i s e m e n t G r i d F i l t e r   =   f u n c t i o n ( c b x A c t i v a t e C o n t e s t S e l e c t o r I d ,   d d l A c t u a l C o n t e s t s I d ,   h f S e l e c t e d C o n t e s t I d ,   a c t u a l C o n t e s t s P o s t b a c k C a l l )   {  
         c t r l A d v e r t i s e m e n t G r i d F i l t e r . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . c b x A c t i v a t e C o n t e s t S e l e c t o r   =   " # "   +   c b x A c t i v a t e C o n t e s t S e l e c t o r I d ;  
         t h i s . d d l A c t u a l C o n t e s t s   =   " # "   +   d d l A c t u a l C o n t e s t s I d ;  
         t h i s . h f S e l e c t e d C o n t e s t   =   " # "   +   h f S e l e c t e d C o n t e s t I d ;  
         t h i s . a c t u a l C o n t e s t s P o s t b a c k C a l l   =   a c t u a l C o n t e s t s P o s t b a c k C a l l ;  
 }  
  
 c t r l A d v e r t i s e m e n t G r i d F i l t e r . p r o t o t y p e   =   {  
  
         A c t i v a t e C o n t e s t S e l e c t o r :   f u n c t i o n ( )   {  
                 v a r   i s E n a b l e C o n t e s t S e l e c t o r   =   $ ( t h i s . c b x A c t i v a t e C o n t e s t S e l e c t o r ) . a t t r ( " c h e c k e d " ) ;  
                 i f   ( i s E n a b l e C o n t e s t S e l e c t o r )   {  
                         $ ( t h i s . d d l A c t u a l C o n t e s t s ) . r e m o v e A t t r ( " d i s a b l e d " ) ;  
                 }  
                 e l s e   {  
                         $ ( t h i s . d d l A c t u a l C o n t e s t s ) . a t t r ( " d i s a b l e d " ,   " d i s a b l e d " ) ;  
                         e v a l ( t h i s . a c t u a l C o n t e s t s P o s t b a c k C a l l ) ;  
                 }  
         } ,  
         S e l e c t C o n t e s t :   f u n c t i o n ( )   {  
                 $ ( t h i s . h f S e l e c t e d C o n t e s t ) . v a l ( $ ( t h i s . d d l A c t u a l C o n t e s t s ) . v a l ( ) ) ;  
         }  
 }  
 c t r l A d v e r t i s e m e n t G r i d F i l t e r . r e g i s t e r C l a s s ( ' c t r l A d v e r t i s e m e n t G r i d F i l t e r ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l C o m p e t i t i o n M o v i e s G r i d E l e m e n t   =   f u n c t i o n ( d d l P l a c e I d ,   h f S e l e c t e d P l a c e I d )   {  
 c t r l C o m p e t i t i o n M o v i e s G r i d E l e m e n t . i n i t i a l i z e B a s e ( t h i s ) ;  
 t h i s . d d l P l a c e   =   " # "   +   d d l P l a c e I d ;  
         t h i s . h f S e l e c t e d P l a c e   =   " # "   +   h f S e l e c t e d P l a c e I d ;  
 }  
  
 c t r l C o m p e t i t i o n M o v i e s G r i d E l e m e n t . p r o t o t y p e   =   {  
         S e l e c t P l a c e :   f u n c t i o n ( )   {  
         $ ( t h i s . h f S e l e c t e d P l a c e ) . v a l ( $ ( t h i s . d d l P l a c e ) . v a l ( ) ) ;  
         }  
 }  
 c t r l C o m p e t i t i o n M o v i e s G r i d E l e m e n t . r e g i s t e r C l a s s ( ' c t r l C o m p e t i t i o n M o v i e s G r i d E l e m e n t ' ,   M i l l i o n Y o u B a s e ) ;  
 c t r l W a i t i n g R o o m M e n u   =   f u n c t i o n ( d d l C o n t e s t s I d ,   h f S e l e c t e d C o n t e s t D r o p I d ,   h f S e l e c t e d C o n t e s t I d )   {  
         c t r l W a i t i n g R o o m M e n u . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . d d l C o n t e s t s   =   " # "   +   d d l C o n t e s t s I d ;  
         t h i s . h f S e l e c t e d C o n t e s t   =   " # "   +   h f S e l e c t e d C o n t e s t I d ;  
         t h i s . h f S e l e c t e d C o n t e s t D r o p   =   " # "   +   h f S e l e c t e d C o n t e s t D r o p I d ;  
 }  
  
 c t r l W a i t i n g R o o m M e n u . p r o t o t y p e   =   {  
  
         S e l e c t C o n t e s t :   f u n c t i o n ( )   {  
         $ ( t h i s . h f S e l e c t e d C o n t e s t ) . v a l ( $ ( t h i s . d d l C o n t e s t s ) . v a l ( ) ) ;  
         $ ( t h i s . h f S e l e c t e d C o n t e s t D r o p ) . v a l ( $ ( t h i s . d d l C o n t e s t s ) . v a l ( ) ) ;  
         } ,  
         A d d M e n u L a s t I t e m C s s C l a s s :   f u n c t i o n ( )   {  
                 v a r   m e n u   =   $ ( ' # w a i t i n g R o o m M e n u   l i : l a s t ' ) ;  
                 i f   ( m e n u . h a s C l a s s ( ' t a b C o n t a i n e r ' ) )   {  
                         m e n u . a d d C l a s s ( ' t a b C o n t a i n e r L a s t ' ) ;  
                 }  
                 e l s e   {  
                         m e n u . a d d C l a s s ( ' s e l T a b C o n t a i n e r L a s t ' ) ;  
                 }  
         }  
 }  
 c t r l W a i t i n g R o o m M e n u . r e g i s t e r C l a s s ( ' c t r l W a i t i n g R o o m M e n u ' ,   M i l l i o n Y o u B a s e ) ;  
 V i d e o U p l o a d   =   f u n c t i o n   ( h f R o l e s J s o n I d ,   h f S e l e c t e d R o l e s I d ,   m i n i m u m O n e R o l e M e s s a g e ,   h f S e l e c t e d F r a m e I d ,  
 m i n i m u m T a g s C o u n t ,   m i n i m u m T a g s C o u n t M e s s a g e ,   h f C a t e g o r i e s J s o n I d ,   h f S e l e c t e d C a t e g o r i e s J s o n I d ,   c o u n t e r T e m p l a t e ,  
 f r a m e N o t S e l e c t e d M e s s a g e ,   m i n T i t l e L e n g t h ,   m a x T i t l e L e n g t h ,   t i t l e L e n g t h E r r o r ,   t i t l e R e g e x ,   t i t l e E r r o r ,   m i n D e s c r i p t i o n L e n g t h ,  
 m a x D e s c r i p t i o n L e n g t h ,   d e s c r i p t i o n L e n g t h E r r o r , d e s c r i p t i o n E r r o r ,   t x t T i t l e I d ,   t x t D e s c r i p t i o n I d ,   m a x C a t e g o r i e s C o u n t ,   c a t e g o r i e s C o u n t E r r o r ,  
 d i v V i d e o U p l o a d E r r o r I d ,   d i v T i t l e E r r o r I d ,   d i v D e s c r i p t i o n E r r o r I d ,   d i v T a g s E r r o r I d ,   d i v C a t e g o r y E r r o r I d )   {  
         V i d e o U p l o a d . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . h f R o l e s J s o n   =   " # "   +   h f R o l e s J s o n I d ;  
         t h i s . a l l R o l e s   =   e v a l ( $ ( t h i s . h f R o l e s J s o n ) . v a l ( ) ) ;  
         t h i s . h f S e l e c t e d R o l e s   =   " # "   +   h f S e l e c t e d R o l e s I d ;  
  
         v a r   h f S e l e c t e d R o l e s V a l u e   =   $ ( t h i s . h f S e l e c t e d R o l e s ) . v a l ( ) ;  
         t h i s . s e l e c t e d R o l e s   =   h f S e l e c t e d R o l e s V a l u e   ! =   ' '   ?   e v a l ( h f S e l e c t e d R o l e s V a l u e )   :   n e w   A r r a y ( ) ;  
  
         t h i s . m i n i m u m O n e R o l e M e s s a g e   =   m i n i m u m O n e R o l e M e s s a g e ;  
         t h i s . h f S e l e c t e d F r a m e   =   " # "   +   h f S e l e c t e d F r a m e I d ;  
         t h i s . m i n i m u m T a g s C o u n t   =   m i n i m u m T a g s C o u n t ;  
         t h i s . m i n i m u m T a g s C o u n t M e s s a g e   =   m i n i m u m T a g s C o u n t M e s s a g e ;  
         t h i s . h f C a t e g o r i e s J s o n   =   " # "   +   h f C a t e g o r i e s J s o n I d ;  
         t h i s . a l l C a t e g o r i e s   =   e v a l ( $ ( t h i s . h f C a t e g o r i e s J s o n ) . v a l ( ) ) ;  
         t h i s . h f S e l e c t e d C a t e g o r i e s J s o n   =   " # "   +   h f S e l e c t e d C a t e g o r i e s J s o n I d ;  
         v a r   h f S e l e c t e d C a t e g o r i e s V a l u e   =   $ ( t h i s . h f S e l e c t e d C a t e g o r i e s J s o n ) . v a l ( ) ;  
         t h i s . s e l e c t e d C a t e g o r i e s   =   h f S e l e c t e d C a t e g o r i e s V a l u e   ! =   ' '   ?   e v a l ( h f S e l e c t e d C a t e g o r i e s V a l u e )   :   n e w   A r r a y ( ) ;  
         t h i s . c o u n t e r T e m p l a t e   =   c o u n t e r T e m p l a t e ;  
         t h i s . f r a m e N o t S e l e c t e d M e s s a g e   =   f r a m e N o t S e l e c t e d M e s s a g e ;  
         t h i s . m i n T i t l e L e n g t h   =   m i n T i t l e L e n g t h ;  
         t h i s . m a x T i t l e L e n g t h   =   m a x T i t l e L e n g t h ;  
         t h i s . t i t l e L e n g t h E r r o r   =   t i t l e L e n g t h E r r o r ;  
         t h i s . t i t l e R e g e x   =   t i t l e R e g e x ;  
         t h i s . t i t l e E r r o r   =   t i t l e E r r o r ;  
         t h i s . m i n D e s c r i p t i o n L e n g t h   =   m i n D e s c r i p t i o n L e n g t h ;  
         t h i s . m a x D e s c r i p t i o n L e n g t h   =   m a x D e s c r i p t i o n L e n g t h ;  
         t h i s . d e s c r i p t i o n L e n g t h E r r o r   =   d e s c r i p t i o n L e n g t h E r r o r ;  
         t h i s . d e s c r i p t i o n E r r o r   =   d e s c r i p t i o n E r r o r ;  
         t h i s . t x t T i t l e   =   " # "   +   t x t T i t l e I d ;  
         t h i s . t x t D e s c r i p t i o n   =   " # "   +   t x t D e s c r i p t i o n I d ;  
         t h i s . m a x C a t e g o r i e s C o u n t   =   m a x C a t e g o r i e s C o u n t ;  
         t h i s . c a t e g o r i e s C o u n t E r r o r   =   c a t e g o r i e s C o u n t E r r o r ;  
         t h i s . d i v V i d e o U p l o a d E r r o r   =   " # "   +   d i v V i d e o U p l o a d E r r o r I d ;  
         t h i s . d i v T i t l e E r r o r   =   " # "   +   d i v T i t l e E r r o r I d ;  
         t h i s . d i v D e s c r i p t i o n E r r o r   =   " # "   +   d i v D e s c r i p t i o n E r r o r I d ;  
         t h i s . d i v T a g s E r r o r   =   " # "   +   d i v T a g s E r r o r I d ;  
         t h i s . d i v C a t e g o r y E r r o r   =   " # "   +   d i v C a t e g o r y E r r o r I d ;  
 }  
 V i d e o U p l o a d . p r o t o t y p e   =   {  
  
         / / A k c j a   k l i k n i e c i a   n a   c h e c k b o x   z   r o l a  
         C h e c k B o x C l i c k e d :   f u n c t i o n   ( c h e c k B o x I d ,   r o l e I n d e x )   {  
                 v a r   c h e c k e d   =   $ ( " # "   +   S t r i n g ( c h e c k B o x I d ) ) . a t t r ( ' c h e c k e d ' ) ;  
                 v i d e o U p l o a d . a l l R o l e s [ r o l e I n d e x ] . I s C h e c k e d   =   c h e c k e d ;  
                 i f   ( c h e c k e d )   {  
                         v i d e o U p l o a d . s e l e c t e d R o l e s . p u s h ( v i d e o U p l o a d . a l l R o l e s [ r o l e I n d e x ] ) ;  
                 }  
                 e l s e   {  
                         v a r   r o l e I d   =   v i d e o U p l o a d . a l l R o l e s [ r o l e I n d e x ] . R o l e I d ;  
                         v a r   t m p R o l e I n d e x ;  
                         f o r   ( v a r   i   =   0 ;   i   <   v i d e o U p l o a d . s e l e c t e d R o l e s . l e n g t h ;   i + + )   {  
                                 i f   ( v i d e o U p l o a d . s e l e c t e d R o l e s [ i ] . R o l e I d   = =   r o l e I d )   {  
                                         t m p R o l e I n d e x   =   i ;  
                                 }  
                         }  
                         v i d e o U p l o a d . s e l e c t e d R o l e s . s p l i c e ( t m p R o l e I n d e x ,   1 ) ;  
                 }  
                 $ ( t h i s . h f S e l e c t e d R o l e s ) . v a l ( t o J s o n S t r i n g ( v i d e o U p l o a d . s e l e c t e d R o l e s ) ) ;  
         } ,  
  
         / / W y b i e r a   w s z y s t k i e   r o l e  
         S e l e c t A l l R o l e s :   f u n c t i o n   ( )   {  
                 $ ( " . c b U s e r R o l e " ) . a t t r ( ' c h e c k e d ' ,   t r u e ) ;  
                 v i d e o U p l o a d . s e l e c t e d R o l e s   =   e v a l ( $ ( v i d e o U p l o a d . h f R o l e s J s o n ) . v a l ( ) ) ;  
                 $ ( t h i s . h f S e l e c t e d R o l e s ) . v a l ( t o J s o n S t r i n g ( v i d e o U p l o a d . s e l e c t e d R o l e s ) ) ;  
         } ,  
  
         / / W a l i d u j e   r o l e   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e R o l e s :   f u n c t i o n   ( )   {  
                 i f   ( v i d e o U p l o a d . s e l e c t e d R o l e s . l e n g t h   <   1 )   {  
                         $ ( t h i s . d i v V i d e o U p l o a d E r r o r ) . h t m l ( v i d e o U p l o a d . m i n i m u m O n e R o l e M e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( t h i s . d i v V i d e o U p l o a d E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / W y b i e r a   m i n i a t u r k  
         S e l e c t F r a m e :   f u n c t i o n   ( f r a m e U r l ,   s o u r c e D i v )   {  
                 $ ( t h i s . h f S e l e c t e d F r a m e ) . v a l ( f r a m e U r l ) ;  
                 $ ( " . d i v T h u m b n a i l " ) . r e m o v e C l a s s ( " a c t i v e T h u m b " ) ;  
                 $ ( " # "   +   s o u r c e D i v ) . a d d C l a s s ( " a c t i v e T h u m b " ) ;  
         } ,  
  
         / / S p r a w d z a   c z y   m i n i a t u r k a   z o s t a l a   w y b r a n a   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e F r a m e s :   f u n c t i o n   ( )   {  
                 i f   ( $ ( t h i s . h f S e l e c t e d F r a m e ) . v a l ( )   = =   ' ' )   {  
                         $ ( t h i s . d i v V i d e o U p l o a d E r r o r ) . h t m l ( v i d e o U p l o a d . f r a m e N o t S e l e c t e d M e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( t h i s . d i v V i d e o U p l o a d E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / S p r a w d z a   i l o s c   d o d a n y c h   t a g ó w   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e T a g s C o u n t :   f u n c t i o n   ( )   {  
                 v a r   v a l i d   =   t a g s L i s t . V a l i d a t e T a g s ( v i d e o U p l o a d . m i n i m u m T a g s C o u n t ) ;  
                 i f   ( ! v a l i d )  
                         $ ( t h i s . d i v T a g s E r r o r ) . h t m l ( v i d e o U p l o a d . m i n i m u m T a g s C o u n t M e s s a g e . r e p l a c e ( " { 0 } " ,   v i d e o U p l o a d . m i n i m u m T a g s C o u n t ) ) . s h o w ( ) ;  
                 e l s e  
                         $ ( t h i s . d i v T a g s E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   v a l i d ;  
         } ,  
  
         / / A k c j a   k l i k n i e c i a   n a   c h e c k b o x   z   k a t e g o r i a  
         C h e c k B o x C a t e g o r y C l i c k e d :   f u n c t i o n   ( c h e c k B o x C a t e g o r y I d ,   c a t e g o r y I n d e x )   {  
                 v a r   c h e c k e d   =   $ ( " # "   +   S t r i n g ( c h e c k B o x C a t e g o r y I d ) ) . a t t r ( ' c h e c k e d ' ) ;  
                 v i d e o U p l o a d . a l l C a t e g o r i e s [ c a t e g o r y I n d e x ] . I s C h e c k e d   =   c h e c k e d ;  
                 i f   ( c h e c k e d )   {  
                         v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s . p u s h ( v i d e o U p l o a d . a l l C a t e g o r i e s [ c a t e g o r y I n d e x ] ) ;  
                 }  
                 e l s e   {  
                         v a r   c a t e g o r y I d   =   v i d e o U p l o a d . a l l C a t e g o r i e s [ c a t e g o r y I n d e x ] . C a t e g o r y I d ;  
                         v a r   t m p C a t e g o r y I n d e x ;  
                         f o r   ( v a r   i   =   0 ;   i   <   v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s . l e n g t h ;   i + + )   {  
                                 i f   ( v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s [ i ] . C a t e g o r y I d   = =   c a t e g o r y I d )   {  
                                         t m p C a t e g o r y I n d e x   =   i ;  
                                 }  
                         }  
                         v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s . s p l i c e ( t m p C a t e g o r y I n d e x ,   1 ) ;  
                 }  
                 $ ( t h i s . h f S e l e c t e d C a t e g o r i e s J s o n ) . v a l ( t o J s o n S t r i n g ( v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s ) ) ;  
         } ,  
  
         / / A k t u a l i z u j e   l i c z n i k   w p i s a n y c h   z n a k o w   z   T e x t B o x a  
         U p d a t e C o u n t e r :   f u n c t i o n   ( d e s t i n a t i o n D i v ,   s o u r c e T e x t B o x ,   m a x C o u n t )   {  
                 v a r   c u r r e n t T e x t   =   $ ( " # "   +   s o u r c e T e x t B o x ) . v a l ( ) ;  
                 i f   ( c u r r e n t T e x t   = =   u n d e f i n e d )  
                         r e t u r n ;  
                 v a r   c u r r e n t L e n g t h   =   c u r r e n t T e x t . l e n g t h ;  
                 i f   ( c u r r e n t L e n g t h   >   m a x C o u n t )   {  
                         / / $ ( " # "   +   s o u r c e T e x t B o x ) . v a l ( c u r r e n t T e x t . s u b s t r i n g ( 0 ,   m a x C o u n t ) ) ;  
                         c u r r e n t L e n g t h - - ;  
                 }  
                 v a r   l a b e l   =   v i d e o U p l o a d . c o u n t e r T e m p l a t e . r e p l a c e ( ' { 0 } ' ,   c u r r e n t L e n g t h ) ;  
                 l a b e l   =   l a b e l . r e p l a c e ( ' { 1 } ' ,   m a x C o u n t ) ;  
                 $ ( " # "   +   d e s t i n a t i o n D i v ) . h t m l ( l a b e l ) ;  
         } ,  
  
         / / W a l i d u j e   t y t u l   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e T i t l e :   f u n c t i o n   ( )   {  
                 v a r   t e x t   =   $ ( v i d e o U p l o a d . t x t T i t l e ) . v a l ( ) ;  
                 / / v a r   r e   =   n e w   R e g E x p ( " " ) ;  
                 i f   ( t e x t . l e n g t h   <   v i d e o U p l o a d . m i n T i t l e L e n g t h   | |   t e x t . l e n g t h   >   v i d e o U p l o a d . m a x T i t l e L e n g t h )   {  
                         v a r   m e s s a g e   =   v i d e o U p l o a d . t i t l e L e n g t h E r r o r . r e p l a c e ( " { 0 } " ,   v i d e o U p l o a d . m i n T i t l e L e n g t h ) ;  
                         m e s s a g e   =   m e s s a g e . r e p l a c e ( " { 1 } " ,   v i d e o U p l o a d . m a x T i t l e L e n g t h ) ;  
                         $ ( t h i s . d i v T i t l e E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 e l s e   i f   ( ! t e x t . m a t c h ( / ^ [ a - z A - Z \ d \ + \ s \ - \ " \ ' _ \ ( \ ) \ ? \ ! \ . \ , : ; \ * \ % \ / _ Ó ZA{yCó [B|zD] + $ / ) )   {  
                         v a r   m e s s a g e   =   t h i s . t i t l e E r r o r ;  
                         $ ( t h i s . d i v T i t l e E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( t h i s . d i v T i t l e E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / W a l i d u j e   o p i s   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e D e s c r i p t i o n :   f u n c t i o n   ( )   {  
                 v a r   t e x t   =   $ ( v i d e o U p l o a d . t x t D e s c r i p t i o n ) . v a l ( ) ;  
                 i f   ( t e x t . l e n g t h   <   v i d e o U p l o a d . m i n D e s c r i p t i o n L e n g t h   | |   t e x t . l e n g t h   >   v i d e o U p l o a d . m a x D e s c r i p t i o n L e n g t h )   {  
                         v a r   m e s s a g e   =   v i d e o U p l o a d . d e s c r i p t i o n L e n g t h E r r o r . r e p l a c e ( " { 0 } " ,   v i d e o U p l o a d . m i n D e s c r i p t i o n L e n g t h ) ;  
                         m e s s a g e   =   m e s s a g e . r e p l a c e ( " { 1 } " ,   v i d e o U p l o a d . m a x D e s c r i p t i o n L e n g t h ) ;  
                         $ ( t h i s . d i v D e s c r i p t i o n E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 / /                 e l s e   i f   ( ! t e x t . m a t c h ( / ^ [ a - z A - Z \ d \ + \ s \ - \ _ \ . \ , \ * \ % \ / : Ó ZA{yCó [B|zD] + $ / ) )   {  
                 / /                         v a r   m e s s a g e   =   t h i s . d e s c r i p t i o n E r r o r ;  
                 / /                         $ ( t h i s . d i v D e s c r i p t i o n E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                 / /                         r e t u r n   f a l s e ;  
                 / /                 }  
                 $ ( t h i s . d i v D e s c r i p t i o n E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / W a l i d u j e   k a t e g o r i e   i   w y s w i e t l a   k o u m i n i a t   o   b l e d z i e  
         V a l i d a t e C a t e g o r i e s :   f u n c t i o n   ( )   {  
                 i f   ( v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s . l e n g t h   <   1   | |   v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s . l e n g t h   >   v i d e o U p l o a d . m a x C a t e g o r i e s C o u n t + 1 )   {  
                         v a r   m e s s a g e   =   v i d e o U p l o a d . c a t e g o r i e s C o u n t E r r o r . r e p l a c e ( " { 0 } " ,   1 ) ;  
                         m e s s a g e   =   m e s s a g e . r e p l a c e ( " { 1 } " ,   v i d e o U p l o a d . m a x C a t e g o r i e s C o u n t ) ;  
                         $ ( t h i s . d i v C a t e g o r y E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( t h i s . d i v C a t e g o r y E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / Z b i o r c z a   m e t o d a   w a l i d u j a c a   w s z y s t k i e   e l e m e n t y   s k l a d a j a c e   s i e   n a   d r u g i   k r o k   d o d a w a n i a   w i d e o  
         V a l i d a t e S e c o n d S t e p :   f u n c t i o n   ( )   {  
                 v a r   i s V a l i d   =   t r u e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e F r a m e s ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e T i t l e ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e D e s c r i p t i o n ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e T a g s C o u n t ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e C a t e g o r i e s ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 r e t u r n   i s V a l i d ;  
         } ,  
  
         V a l i d a t e E d i t :   f u n c t i o n   ( )   {  
                 v a r   i s V a l i d   =   t r u e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e T i t l e ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e D e s c r i p t i o n ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e T a g s C o u n t ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e C a t e g o r i e s ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! v i d e o U p l o a d . V a l i d a t e R o l e s ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 r e t u r n   i s V a l i d ;  
         } ,  
  
         / / A k t u a l i z u j e   w y b r a n e   k a t e g o r i e   z   w a r t o s c i   u s t a w i o n e j   w   h i d d e n i e  
         U p d a t e S e l e c t e d C a t e g o r i e s :   f u n c t i o n   ( )   {  
                 $ ( " . c b M o v i e C a t e g o r y " ) . e a c h ( f u n c t i o n   ( )   {  
                         v a r   c a t e g o r y I d   =   $ ( t h i s ) . v a l ( ) ;  
                         $ ( t h i s ) . a t t r ( ' c h e c k e d ' ,   f a l s e ) ;  
                         f o r   ( v a r   i   =   0 ;   i   <   v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s . l e n g t h ;   i + + )   {  
                                 i f   ( v i d e o U p l o a d . s e l e c t e d C a t e g o r i e s [ i ] . C a t e g o r y I d   = =   c a t e g o r y I d )   {  
                                         $ ( t h i s ) . a t t r ( ' c h e c k e d ' ,   t r u e ) ;  
                                         b r e a k ;  
                                 }  
                         }  
                 } ) ;  
         } ,  
  
         / / A k t u a l i z u j e   w y b r a n e   r o l e   z   w a r t o s c i   u s t a w i o n e j   w   h i d d e n i e  
         U p d a t e S e l e c t e d R o l e s :   f u n c t i o n   ( )   {  
                 $ ( " . c b U s e r R o l e " ) . e a c h ( f u n c t i o n   ( )   {  
                         v a r   r o l e I d   =   $ ( t h i s ) . v a l ( ) ;  
                         $ ( t h i s ) . a t t r ( ' c h e c k e d ' ,   f a l s e ) ;  
                         f o r   ( v a r   i   =   0 ;   i   <   v i d e o U p l o a d . s e l e c t e d R o l e s . l e n g t h ;   i + + )   {  
                                 i f   ( v i d e o U p l o a d . s e l e c t e d R o l e s [ i ] . R o l e I d   = =   r o l e I d )   {  
                                         $ ( t h i s ) . a t t r ( ' c h e c k e d ' ,   t r u e ) ;  
                                         b r e a k ;  
                                 }  
                         }  
                 } ) ;  
         } ,  
  
         U p d a t e S e l e c t e d F r a m e :   f u n c t i o n   ( )   {  
                 v a r   s r c   =   $ ( v i d e o U p l o a d . h f S e l e c t e d F r a m e ) . v a l ( ) ;  
                 i f   ( s r c   ! =   ' '   & &   s r c   ! =   u n d e f i n e d )   {  
                         v a r   c o s 3   =   $ ( " d i v : h a s ( i m g [ s r c $ = ' "   +   s r c   +   " ' ] ) ,   . d i v T h u m b n a i l " ) ;  
                         $ ( " d i v : h a s ( i m g [ s r c $ = ' "   +   s r c   +   " ' ] ) : l a s t " ) . c s s ( ' b a c k g r o u n d - c o l o r ' ,   ' y e l l o w ' ) ;  
                 }  
         } ,  
  
         T o g g l e C a t e g o r y C h e c k b o x :   f u n c t i o n   ( )   {  
                 v a r   n   =   $ ( " . m o v i e C a t e g o r i e s   i n p u t : c h e c k e d " ) . l e n g t h ;  
                 i f   ( n   >   2 )  
                         $ ( " . m o v i e C a t e g o r i e s   i n p u t : n o t ( : c h e c k e d ) " ) . a t t r ( " d i s a b l e d " ,   " d i s a b l e d " ) ;  
                 e l s e  
                         $ ( " . m o v i e C a t e g o r i e s   i n p u t : n o t ( : c h e c k e d ) " ) . r e m o v e A t t r ( " d i s a b l e d " ) ;  
         }  
 }  
  
 V i d e o U p l o a d . r e g i s t e r C l a s s ( ' V i d e o U p l o a d ' ,   M i l l i o n Y o u B a s e ) ;  
 C r e a t e S c e n a r i o   =   f u n c t i o n   (  
 m i n i m u m T a g s C o u n t ,   m i n i m u m T a g s C o u n t M e s s a g e ,   c o u n t e r T e m p l a t e ,  
 m i n T i t l e L e n g t h ,   m a x T i t l e L e n g t h ,   m i n D e s c r i p t i o n L e n g t h ,  
 m a x D e s c r i p t i o n L e n g t h ,   t x t T i t l e I d ,   t x t D e s c r i p t i o n I d ,   f c k S c e n a r i o I d ,   s c e n a r i o M i n L e n g t h ,  
 d i v F c k E r r o r ,   d i v T i t l e E r r o r ,   d i v D e s c r i p t i o n E r r o r ,   d i v T a g s E r r o r ,   t i t l e E r r o r T e x t )   {  
         C r e a t e S c e n a r i o . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . m i n i m u m T a g s C o u n t   =   m i n i m u m T a g s C o u n t ;  
         t h i s . m i n i m u m T a g s C o u n t M e s s a g e   =   m i n i m u m T a g s C o u n t M e s s a g e ;  
         t h i s . c o u n t e r T e m p l a t e   =   c o u n t e r T e m p l a t e ;  
         t h i s . m i n T i t l e L e n g t h   =   m i n T i t l e L e n g t h ;  
         t h i s . m a x T i t l e L e n g t h   =   m a x T i t l e L e n g t h ;  
         t h i s . m i n D e s c r i p t i o n L e n g t h   =   m i n D e s c r i p t i o n L e n g t h ;  
         t h i s . m a x D e s c r i p t i o n L e n g t h   =   m a x D e s c r i p t i o n L e n g t h ;  
         t h i s . t x t T i t l e   =   " # "   +   t x t T i t l e I d ;  
         t h i s . t x t D e s c r i p t i o n   =   " # "   +   t x t D e s c r i p t i o n I d ;  
         t h i s . f c k S c e n a r i o   =   f c k S c e n a r i o I d ;  
         t h i s . s c e n a r i o M i n L e n g t h   =   s c e n a r i o M i n L e n g t h ;  
         t h i s . d i v F c k E r r o r   =   " # "   +   d i v F c k E r r o r ;  
         t h i s . d i v T i t l e E r r o r   =   " # "   +   d i v T i t l e E r r o r ;  
         t h i s . d i v D e s c r i p t i o n E r r o r   =   " # "   +   d i v D e s c r i p t i o n E r r o r ;  
         t h i s . d i v T a g s E r r o r   =   " # "   +   d i v T a g s E r r o r ;  
         t h i s . t i t l e E r r o r   =   t i t l e E r r o r T e x t ;  
 }  
 C r e a t e S c e n a r i o . p r o t o t y p e   =   {  
  
         / / W a l i d u j e   f c k E d i t o r a  
         V a l i d a t e F c k E d i t o r :   f u n c t i o n ( )   {  
                 v a r   f c k V a l i d   =   f a l s e ;  
                 v a r   s t r F C K E d i t o r T e x t L e n g t h   =   c r e a t e S c e n a r i o . G e t F c k E d i t o r P l a i n T e x t L e n g t h ( c r e a t e S c e n a r i o . f c k S c e n a r i o ) ;  
                 i f   ( s t r F C K E d i t o r T e x t L e n g t h   > =   c r e a t e S c e n a r i o . s c e n a r i o M i n L e n g t h )   {  
                         f c k V a l i d   =   t r u e ;  
                         $ ( c r e a t e S c e n a r i o . d i v F c k E r r o r ) . h i d e ( ) ;  
                 }  
                 e l s e   {  
                         $ ( c r e a t e S c e n a r i o . d i v F c k E r r o r ) . s h o w ( ) ;  
                         f c k V a l i d   =   f a l s e ;  
                 }  
                 r e t u r n   f c k V a l i d ;  
         } ,  
  
         / / S p r a w d z a   i l o s c   d o d a n y c h   t a g ó w   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e T a g s C o u n t :   f u n c t i o n ( )   {  
                 v a r   v a l i d   =   t a g s L i s t . V a l i d a t e T a g s ( c r e a t e S c e n a r i o . m i n i m u m T a g s C o u n t ) ;  
                 i f   ( ! v a l i d )  
                         $ ( c r e a t e S c e n a r i o . d i v T a g s E r r o r ) . s h o w ( ) ;  
                 e l s e  
                         $ ( c r e a t e S c e n a r i o . d i v T a g s E r r o r ) . h i d e ( ) ;  
                 r e t u r n   v a l i d ;  
         } ,  
  
         / / A k t u a l i z u j e   l i c z n i k   w p i s a n y c h   z n a k o w   z   T e x t B o x a  
         U p d a t e C o u n t e r :   f u n c t i o n ( d e s t i n a t i o n D i v ,   s o u r c e T e x t B o x ,   m a x C o u n t )   {  
                 v a r   c u r r e n t T e x t   =   $ ( " # "   +   s o u r c e T e x t B o x ) . v a l ( ) ;  
                 i f   ( c u r r e n t T e x t   = =   u n d e f i n e d )  
                         r e t u r n ;  
                 v a r   c u r r e n t L e n g t h   =   c u r r e n t T e x t . l e n g t h ;  
                 i f   ( c u r r e n t L e n g t h   >   m a x C o u n t )   {  
                         / / $ ( " # "   +   s o u r c e T e x t B o x ) . v a l ( c u r r e n t T e x t . s u b s t r i n g ( 0 ,   m a x C o u n t ) ) ;  
                         c u r r e n t L e n g t h - - ;  
                 }  
                 v a r   l a b e l   =   c r e a t e S c e n a r i o . c o u n t e r T e m p l a t e . r e p l a c e ( ' { 0 } ' ,   c u r r e n t L e n g t h ) ;  
                 l a b e l   =   l a b e l . r e p l a c e ( ' { 1 } ' ,   m a x C o u n t ) ;  
                 $ ( " # "   +   d e s t i n a t i o n D i v ) . h t m l ( l a b e l ) ;  
         } ,  
  
         / / W a l i d u j e   t y t u l   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e T i t l e :   f u n c t i o n ( )   {  
                 v a r   t e x t   =   $ ( c r e a t e S c e n a r i o . t x t T i t l e ) . v a l ( ) ;  
                 i f   ( t e x t . l e n g t h   <   c r e a t e S c e n a r i o . m i n T i t l e L e n g t h   | |   t e x t . l e n g t h   >   c r e a t e S c e n a r i o . m a x T i t l e L e n g t h )   {  
                         $ ( c r e a t e S c e n a r i o . d i v T i t l e E r r o r ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 e l s e   i f   ( ! t e x t . m a t c h ( / ^ [ a - z A - Z \ d \ + \ s \ - \ " \ ' _ \ ( \ ) \ ? \ ! \ . \ , : ; \ * \ % \ / _ Ó ZA{yCó [B|zD] + $ / ) )   {  
                         v a r   m e s s a g e   =   c r e a t e S c e n a r i o . t i t l e E r r o r ;  
                         $ ( c r e a t e S c e n a r i o . d i v T i t l e E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( c r e a t e S c e n a r i o . d i v T i t l e E r r o r ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / W a l i d u j e   o p i s   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e D e s c r i p t i o n :   f u n c t i o n ( )   {  
                 v a r   t e x t   =   $ ( c r e a t e S c e n a r i o . t x t D e s c r i p t i o n ) . v a l ( ) ;  
                 i f   ( t e x t . l e n g t h   <   c r e a t e S c e n a r i o . m i n D e s c r i p t i o n L e n g t h   | |   t e x t . l e n g t h   >   c r e a t e S c e n a r i o . m a x D e s c r i p t i o n L e n g t h )   {  
                         $ ( c r e a t e S c e n a r i o . d i v D e s c r i p t i o n E r r o r ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( c r e a t e S c e n a r i o . d i v D e s c r i p t i o n E r r o r ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / W a l i d u j e   s c e n a r i u s z  
         V a l i d a t e S c e n a r i o :   f u n c t i o n ( )   {  
                 v a r   i s V a l i d   =   t r u e ;  
                 i f   ( ! c r e a t e S c e n a r i o . V a l i d a t e F c k E d i t o r ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! c r e a t e S c e n a r i o . V a l i d a t e T a g s C o u n t ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! c r e a t e S c e n a r i o . V a l i d a t e T i t l e ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! c r e a t e S c e n a r i o . V a l i d a t e D e s c r i p t i o n ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 r e t u r n   i s V a l i d ;  
         }  
  
 }  
  
 C r e a t e S c e n a r i o . r e g i s t e r C l a s s ( ' C r e a t e S c e n a r i o ' ,   M i l l i o n Y o u B a s e ) ;  
 C r e a t e M u s i c   =   f u n c t i o n   (  
 m i n i m u m T a g s C o u n t ,   m i n i m u m T a g s C o u n t M e s s a g e ,   c o u n t e r T e m p l a t e ,  
 m i n T i t l e L e n g t h ,   m a x T i t l e L e n g t h ,   t i t l e L e n g t h E r r o r ,   m i n D e s c r i p t i o n L e n g t h ,  
 m a x D e s c r i p t i o n L e n g t h ,   d e s c r i p t i o n L e n g t h E r r o r ,   t x t T i t l e I d ,   t x t D e s c r i p t i o n I d ,   d i v T i t l e E r r o r I d ,   d i v D e s c r i p t i o n E r r o r I d ,   d i v T a g s E r r o r I d ,   t i t l e E r r o r T e x t )   {  
         C r e a t e M u s i c . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . m i n i m u m T a g s C o u n t   =   m i n i m u m T a g s C o u n t ;  
         t h i s . m i n i m u m T a g s C o u n t M e s s a g e   =   m i n i m u m T a g s C o u n t M e s s a g e ;  
         t h i s . c o u n t e r T e m p l a t e   =   c o u n t e r T e m p l a t e ;  
         t h i s . m i n T i t l e L e n g t h   =   m i n T i t l e L e n g t h ;  
         t h i s . m a x T i t l e L e n g t h   =   m a x T i t l e L e n g t h ;  
         t h i s . t i t l e L e n g t h E r r o r   =   t i t l e L e n g t h E r r o r ;  
         t h i s . m i n D e s c r i p t i o n L e n g t h   =   m i n D e s c r i p t i o n L e n g t h ;  
         t h i s . m a x D e s c r i p t i o n L e n g t h   =   m a x D e s c r i p t i o n L e n g t h ;  
         t h i s . d e s c r i p t i o n L e n g t h E r r o r   =   d e s c r i p t i o n L e n g t h E r r o r ;  
         t h i s . t x t T i t l e   =   " # "   +   t x t T i t l e I d ;  
         t h i s . t x t D e s c r i p t i o n   =   " # "   +   t x t D e s c r i p t i o n I d ;  
         t h i s . d i v T i t l e E r r o r   =   " # "   +   d i v T i t l e E r r o r I d ;  
         t h i s . d i v D e s c r i p t i o n E r r o r   =   " # "   +   d i v D e s c r i p t i o n E r r o r I d ;  
         t h i s . d i v T a g s E r r o r   =   " # "   +   d i v T a g s E r r o r I d ;  
         t h i s . t i t l e E r r o r   =   t i t l e E r r o r T e x t ;  
 }  
 C r e a t e M u s i c . p r o t o t y p e   =   {  
  
         / / S p r a w d z a   i l o s c   d o d a n y c h   t a g ó w   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e T a g s C o u n t :   f u n c t i o n ( )   {  
                 v a r   v a l i d   =   t a g s L i s t . V a l i d a t e T a g s ( c r e a t e M u s i c . m i n i m u m T a g s C o u n t ) ;  
                 i f   ( ! v a l i d )  
                         $ ( t h i s . d i v T a g s E r r o r ) . h t m l ( c r e a t e M u s i c . m i n i m u m T a g s C o u n t M e s s a g e . r e p l a c e ( " { 0 } " ,   c r e a t e M u s i c . m i n i m u m T a g s C o u n t ) ) . s h o w ( ) ;  
                 e l s e  
                         $ ( t h i s . d i v T a g s E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   v a l i d ;  
         } ,  
  
         / / A k t u a l i z u j e   l i c z n i k   w p i s a n y c h   z n a k o w   z   T e x t B o x a  
         U p d a t e C o u n t e r :   f u n c t i o n ( d e s t i n a t i o n D i v ,   s o u r c e T e x t B o x ,   m a x C o u n t )   {  
                 v a r   c u r r e n t T e x t   =   $ ( " # "   +   s o u r c e T e x t B o x ) . v a l ( ) ;  
                 i f   ( c u r r e n t T e x t   = =   u n d e f i n e d )  
                         r e t u r n ;  
                 v a r   c u r r e n t L e n g t h   =   c u r r e n t T e x t . l e n g t h ;  
                 i f   ( c u r r e n t L e n g t h   >   m a x C o u n t )   {  
                         / / $ ( " # "   +   s o u r c e T e x t B o x ) . v a l ( c u r r e n t T e x t . s u b s t r i n g ( 0 ,   m a x C o u n t ) ) ;  
                         c u r r e n t L e n g t h - - ;  
                 }  
                 v a r   l a b e l   =   c r e a t e M u s i c . c o u n t e r T e m p l a t e . r e p l a c e ( ' { 0 } ' ,   c u r r e n t L e n g t h ) ;  
                 l a b e l   =   l a b e l . r e p l a c e ( ' { 1 } ' ,   m a x C o u n t ) ;  
                 $ ( " # "   +   d e s t i n a t i o n D i v ) . h t m l ( l a b e l ) ;  
         } ,  
  
         / / W a l i d u j e   t y t u l   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e T i t l e :   f u n c t i o n ( )   {  
                 v a r   t e x t   =   $ ( c r e a t e M u s i c . t x t T i t l e ) . v a l ( ) ;  
                 i f   ( t e x t . l e n g t h   <   c r e a t e M u s i c . m i n T i t l e L e n g t h   | |   t e x t . l e n g t h   >   c r e a t e M u s i c . m a x T i t l e L e n g t h )   {  
                         v a r   m e s s a g e   =   c r e a t e M u s i c . t i t l e L e n g t h E r r o r . r e p l a c e ( " { 0 } " ,   c r e a t e M u s i c . m i n T i t l e L e n g t h ) ;  
                         m e s s a g e   =   m e s s a g e . r e p l a c e ( " { 1 } " ,   c r e a t e M u s i c . m a x T i t l e L e n g t h ) ;  
                         $ ( t h i s . d i v T i t l e E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 e l s e   i f   ( ! t e x t . m a t c h ( / ^ [ a - z A - Z \ d \ + \ s \ - \ " \ ' _ \ ( \ ) \ ? \ ! \ . \ , : ; \ * \ % \ / _ Ó ZA{yCó [B|zD] + $ / ) )   {  
                         v a r   m e s s a g e   =   c r e a t e M u s i c . t i t l e E r r o r ;  
                         $ ( t h i s . d i v T i t l e E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( t h i s . d i v T i t l e E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
         / / W a l i d u j e   o p i s   i   w y s w i e t l a   k o m u n i k a t   o   b l e d z i e  
         V a l i d a t e D e s c r i p t i o n :   f u n c t i o n ( )   {  
                 v a r   t e x t   =   $ ( c r e a t e M u s i c . t x t D e s c r i p t i o n ) . v a l ( ) ;  
                 i f   ( t e x t . l e n g t h   <   c r e a t e M u s i c . m i n D e s c r i p t i o n L e n g t h   | |   t e x t . l e n g t h   >   c r e a t e M u s i c . m a x D e s c r i p t i o n L e n g t h )   {  
                         v a r   m e s s a g e   =   c r e a t e M u s i c . d e s c r i p t i o n L e n g t h E r r o r . r e p l a c e ( " { 0 } " ,   c r e a t e M u s i c . m i n D e s c r i p t i o n L e n g t h ) ;  
                         m e s s a g e   =   m e s s a g e . r e p l a c e ( " { 1 } " ,   c r e a t e M u s i c . m a x D e s c r i p t i o n L e n g t h ) ;  
                         $ ( t h i s . d i v D e s c r i p t i o n E r r o r ) . h t m l ( m e s s a g e ) . s h o w ( ) ;  
                         r e t u r n   f a l s e ;  
                 }  
                 $ ( t h i s . d i v D e s c r i p t i o n E r r o r ) . h t m l ( ' ' ) . h i d e ( ) ;  
                 r e t u r n   t r u e ;  
         } ,  
  
  
         / / Z b i o r c z a   m e t o d a   w a l i d u j a c a   w s z y s t k i e   e l e m e n t y   s k l a d a j a c e   s i e   n a   d r u g i   k r o k   d o d a w a n i a   m u z y k i  
         V a l i d a t e S e c o n d S t e p :   f u n c t i o n ( )   {  
                 v a r   i s V a l i d   =   t r u e ;  
                 i f   ( ! c r e a t e M u s i c . V a l i d a t e T i t l e ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! c r e a t e M u s i c . V a l i d a t e D e s c r i p t i o n ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 i f   ( ! c r e a t e M u s i c . V a l i d a t e T a g s C o u n t ( ) )  
                         i s V a l i d   =   f a l s e ;  
                 r e t u r n   i s V a l i d ;  
         }  
  
 }  
  
 C r e a t e M u s i c . r e g i s t e r C l a s s ( ' C r e a t e M u s i c ' ,   M i l l i o n Y o u B a s e ) ;  
 P l a c e A n A d v e r t i s e m e n t   =   f u n c t i o n ( f c k A d v e r t i s e m e n t T e x t I d ,   d i v C a t e g o r i e s I d ,   s p a n C a t e g o r i e s E r r o r I d )   {  
         P l a c e A n A d v e r t i s e m e n t . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . f c k A d v e r t i s e m e n t T e x t   =   f c k A d v e r t i s e m e n t T e x t I d ;  
         t h i s . d i v C a t e g o r i e s   =   " # "   +   d i v C a t e g o r i e s I d ;  
         t h i s . s p a n C a t e g o r i e s E r r o r   =   " # "   +   s p a n C a t e g o r i e s E r r o r I d ;  
 }  
  
 P l a c e A n A d v e r t i s e m e n t . p r o t o t y p e   =   {  
  
         V a l i d a t e F c k E d i t o r :   f u n c t i o n ( )   {  
                 v a r   p a g e V a l i d ;  
                 i f   ( t y p e o f   P a g e _ C l i e n t V a l i d a t e   = =   ' f u n c t i o n ' )  
                         p a g e V a l i d   =   P a g e _ C l i e n t V a l i d a t e ( ' a d v e r t i s e m e n t ' ) ;  
                 e l s e  
                         p a g e V a l i d   =   t r u e ;  
                 v a r   f c k V a l i d ;  
                 v a r   s t r F C K E d i t o r T e x t L e n g t h   =   t h i s . G e t F c k E d i t o r P l a i n T e x t L e n g t h ( t h i s . f c k A d v e r t i s e m e n t T e x t ) ;  
                 i f   ( s t r F C K E d i t o r T e x t L e n g t h   > =   2   & &   s t r F C K E d i t o r T e x t L e n g t h   < =   5 0 0 0 )   {  
                         f c k V a l i d   =   t r u e ;  
                         $ ( " # f c k E r r o r " ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                 }  
                 e l s e   {  
                         $ ( " # f c k E r r o r " ) . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
                         f c k V a l i d   =   f a l s e ;  
                 }  
  
                 r e t u r n   ( f c k V a l i d   & &   p a g e V a l i d ) ;  
         } ,  
         V a l i d a t e A d v e r t i s e m e n t P l a c e m e n t :   f u n c t i o n ( )   {  
                 v a r   f c k V a l i d   =   t h i s . V a l i d a t e F c k E d i t o r ( ) ;  
                 v a r   i n p u t s   =   $ ( t h i s . d i v C a t e g o r i e s   +   "   : c h e c k b o x [ c h e c k e d = t r u e ] " ) ;  
                 i f   ( i n p u t s . l e n g t h   >   0   & &   i n p u t s . l e n g t h   <   4 )    
                 {  
                         $ ( t h i s . s p a n C a t e g o r i e s E r r o r ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                         r e t u r n   t r u e   & &   f c k V a l i d ;  
                 }  
                 e l s e   {  
                         $ ( t h i s . s p a n C a t e g o r i e s E r r o r ) . c s s ( " d i s p l a y " ,   " i n l i n e " ) ;  
                         r e t u r n   f a l s e   & &   f c k V a l i d ;  
                 }  
         }  
 }  
 P l a c e A n A d v e r t i s e m e n t . r e g i s t e r C l a s s ( ' P l a c e A n A d v e r t i s e m e n t ' ,   M i l l i o n Y o u B a s e ) ;  
 M o v i e s   =   f u n c t i o n ( h d n M o v i e I d C l i e n t I D ,  
                         h d n P r e v D i v C l i e n t I d ,  
                         e m p t y G u i d ,  
                         h d n P r e v V i d e o s T e a s e r s C l i e n t I D ,  
                         h d n N e x t V i d e o s T e a s e r s C l i e n t I D ,  
                         h d n P r e v V i d e o I d e n t i f i e r s C l i e n t I D ,  
                         h d n N e x t V i d e o I d e n t i f i e r s C l i e n t I D ,  
                         u p D e t a i l s U n i q u e I D )   {  
         M o v i e s . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . h d n M o v i e I d C l i e n t I d   =   h d n M o v i e I d C l i e n t I D ;  
         t h i s . h d n P r e v D i v C l i e n t I d   =   h d n P r e v D i v C l i e n t I d ;  
         t h i s . e m p t y G u i d   =   e m p t y G u i d ;  
         t h i s . h d n P r e v V i d e o s T e a s e r s C l i e n t I d   =   h d n P r e v V i d e o s T e a s e r s C l i e n t I D ;  
         t h i s . h d n N e x t V i d e o s T e a s e r s C l i e n t I d   =   h d n N e x t V i d e o s T e a s e r s C l i e n t I D ;  
         t h i s . h d n P r e v V i d e o I d e n t i f i e r s C l i e n t I d   =   h d n P r e v V i d e o I d e n t i f i e r s C l i e n t I D ;  
         t h i s . h d n N e x t V i d e o I d e n t i f i e r s C l i e n t I d   =   h d n N e x t V i d e o I d e n t i f i e r s C l i e n t I D ;  
         t h i s . u p D e t a i l s U n i q u e I d   =   u p D e t a i l s U n i q u e I D ;  
 }  
  
 M o v i e s . p r o t o t y p e   =   {  
         S h o w M o v i e :   f u n c t i o n ( m o v i e I d ,   d i v C l i e n t I d )   {  
                 t h i s . S h o w M o v i e W i t h o u t S e t t i n g H a s h ( m o v i e I d ,   d i v C l i e n t I d ) ;  
                 d o c u m e n t . l o c a t i o n . h a s h   =   " m o v i e I d = "   +   m o v i e I d ;  
         } ,  
         S h o w M o v i e W i t h o u t S e t t i n g H a s h :   f u n c t i o n ( m o v i e I d ,   d i v C l i e n t I d )   {  
                 / / w s t a w i a m   d o   h d n   i d   w y b r a n e g o   f i l m u  
                 $ ( " # "   +   t h i s . h d n M o v i e I d C l i e n t I d ) . v a l ( m o v i e I d ) ;  
                 / / d o d a n i e   k l a s y   c s s   d l a   w y b r a n e g o   f i l m u  
                 $ ( " # "   +   d i v C l i e n t I d ) . a d d C l a s s ( ' i t e m A c t i v e ' ) ;  
                 / / u s u n i e c i e   k l a s y   c s s   z   p o p r z e d n i o   w y b r a n e g o   f i l m u   ( j e s l i   b y l )  
                 i f   ( $ ( " # "   +   t h i s . h d n P r e v D i v C l i e n t I d ) . v a l ( )   ! =   n u l l )  
                         $ ( " # "   +   $ ( " # "   +   t h i s . h d n P r e v D i v C l i e n t I d ) . v a l ( ) ) . r e m o v e C l a s s ( ' i t e m A c t i v e ' ) ;  
                 / / z a p i s a n i e   d o   h d n   i d   o b r a z k a   d l a   w y b r a n e g o   p l i k u  
                 $ ( " # "   +   t h i s . h d n P r e v D i v C l i e n t I d ) . v a l ( d i v C l i e n t I d ) ;  
  
                 v a r   e l e m e n t s   =   $ ( " # "   +   d i v C l i e n t I d ) . p a r e n t ( ) . c h i l d r e n ( " d i v . i t e m " ) ;  
                 v a r   c u r r e n t E l e m e n t I n d e x   =   0 ;  
                 v a r   p r e v i o u s M o v i e s I d e n t i f i e r s   =   ' ' ;  
                 v a r   p r e v i o u s M o v i e s G u i d s   =   ' ' ;  
                 v a r   n e x t M o v i e s G u i d s   =   ' ' ;  
                 v a r   n e x t M o v i e s I d e n t i f i e r s   =   ' ' ;  
                 e l e m e n t s . e a c h ( f u n c t i o n ( i )   {  
                         i f   ( t h i s . i d   = =   d i v C l i e n t I d )   {  
                                 c u r r e n t E l e m e n t I n d e x   =   i ;  
                                 r e t u r n   f a l s e ;  
                         }  
                 } ) ;  
                 / / e l e m e n t y   p o p r z e d n i e  
                 i f   ( c u r r e n t E l e m e n t I n d e x   -   2   > =   0 )   {  
                         p r e v i o u s M o v i e s I d e n t i f i e r s   =   p r e v i o u s M o v i e s I d e n t i f i e r s   +   " ' "   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   -   2 ] ) [ 0 ] . v a l u e   +   " ' , " ;  
                         p r e v i o u s M o v i e s G u i d s   =   p r e v i o u s M o v i e s G u i d s   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   -   2 ] ) [ 1 ] . v a l u e   +   " , " ;  
                 }  
                 e l s e   {  
                         p r e v i o u s M o v i e s I d e n t i f i e r s   =   p r e v i o u s M o v i e s I d e n t i f i e r s   +   " ' n u l l ' , " ;  
                         p r e v i o u s M o v i e s G u i d s   =   p r e v i o u s M o v i e s G u i d s   +   t h i s . e m p t y G u i d   +   " , " ;  
                 }  
                 i f   ( c u r r e n t E l e m e n t I n d e x   -   1   > =   0 )   {  
                         p r e v i o u s M o v i e s I d e n t i f i e r s   =   p r e v i o u s M o v i e s I d e n t i f i e r s   +   " ' "   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   -   1 ] ) [ 0 ] . v a l u e   +   " ' , " ;  
                         p r e v i o u s M o v i e s G u i d s   =   p r e v i o u s M o v i e s G u i d s   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   -   1 ] ) [ 1 ] . v a l u e ;  
                 }  
                 e l s e   {  
                         p r e v i o u s M o v i e s I d e n t i f i e r s   =   p r e v i o u s M o v i e s I d e n t i f i e r s   +   " ' n u l l ' , " ;  
                         p r e v i o u s M o v i e s G u i d s   =   p r e v i o u s M o v i e s G u i d s   +   t h i s . e m p t y G u i d ;  
                 }  
                 / / e l e m e n t y   n a s t p n e  
                 i f   ( c u r r e n t E l e m e n t I n d e x   +   1   <   e l e m e n t s . l e n g t h )   {  
                         n e x t M o v i e s I d e n t i f i e r s   =   n e x t M o v i e s I d e n t i f i e r s   +   " ' "   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   +   1 ] ) [ 0 ] . v a l u e   +   " ' , " ;  
                         n e x t M o v i e s G u i d s   =   n e x t M o v i e s G u i d s   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   +   1 ] ) [ 1 ] . v a l u e   +   " , " ;  
                 }  
                 e l s e   {  
                         n e x t M o v i e s I d e n t i f i e r s   =   n e x t M o v i e s I d e n t i f i e r s   +   " ' n u l l ' , " ;  
                         n e x t M o v i e s G u i d s   =   n e x t M o v i e s G u i d s   +   t h i s . e m p t y G u i d   +   " , " ;  
                 }  
                 i f   ( c u r r e n t E l e m e n t I n d e x   +   2   > =   0   & &   e l e m e n t s . l e n g t h   >   c u r r e n t E l e m e n t I n d e x   +   2 )   {  
                         n e x t M o v i e s I d e n t i f i e r s   =   n e x t M o v i e s I d e n t i f i e r s   +   " ' "   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   +   2 ] ) [ 0 ] . v a l u e   +   " ' , " ;  
                         n e x t M o v i e s G u i d s   =   n e x t M o v i e s G u i d s   +   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   +   2 ] ) [ 1 ] . v a l u e ;  
                 }  
                 e l s e   {  
                         n e x t M o v i e s I d e n t i f i e r s   =   n e x t M o v i e s I d e n t i f i e r s   +   " ' n u l l ' , " ;  
                         n e x t M o v i e s G u i d s   =   n e x t M o v i e s G u i d s   +   t h i s . e m p t y G u i d ;  
                 }  
                 $ ( " # "   +   t h i s . h d n P r e v V i d e o s T e a s e r s C l i e n t I d ) . v a l ( p r e v i o u s M o v i e s G u i d s ) ;  
                 $ ( " # "   +   t h i s . h d n N e x t V i d e o s T e a s e r s C l i e n t I d ) . v a l ( n e x t M o v i e s G u i d s ) ;  
                 $ ( " # "   +   t h i s . h d n P r e v V i d e o I d e n t i f i e r s C l i e n t I d ) . v a l ( p r e v i o u s M o v i e s I d e n t i f i e r s ) ;  
                 $ ( " # "   +   t h i s . h d n N e x t V i d e o I d e n t i f i e r s C l i e n t I d ) . v a l ( n e x t M o v i e s I d e n t i f i e r s ) ;  
                 _ _ d o P o s t B a c k ( t h i s . u p D e t a i l s U n i q u e I d ,   ' ' ) ;  
         } ,  
         C h e c k F o r H a s h :   f u n c t i o n ( )   {  
                 i f   ( d o c u m e n t . l o c a t i o n . h a s h . m a t c h ( " # m o v i e I d = " )   ! =   n u l l )   {  
                         v a r   m o v i e I d   =   d o c u m e n t . l o c a t i o n . h a s h . r e p l a c e ( / # m o v i e I d = / ,   " " ) ;  
                         v a r   d i v I d   =   $ ( " d i v   i n p u t : h i d d e n [ v a l u e = "   +   m o v i e I d   +   " ] " ) . p a r e n t ( ) . a t t r ( " i d " ) ;  
                         i f   ( d i v I d   ! =   n u l l   & &   d i v I d   ! =   u n d e f i n e d   & &   d i v I d   ! =   ' ' )  
                                 t h i s . S h o w M o v i e W i t h o u t S e t t i n g H a s h ( m o v i e I d ,   d i v I d ) ;  
                 }  
         }  
 }  
 M o v i e s . r e g i s t e r C l a s s ( ' M o v i e s ' ,   M i l l i o n Y o u B a s e ) ;  
 M u s i c   =   f u n c t i o n ( h d n M u s i c I d C l i e n t I d ,  
                         h d n P r e v D i v C l i e n t I d ,  
                         h d n P r e v M u s i c I d e n t i f i e r s C l i e n t I d ,  
                         h d n N e x t M u s i c I d e n t i f i e r s C l i e n t I d ,  
                         u p D e t a i l s U n i q u e I D ,  
                         h f B e f o r e P l a y e d M u s i c C l i e n t I d )   {  
         M u s i c . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . h d n M u s i c I d C l i e n t I d   =   h d n M u s i c I d C l i e n t I d ;  
         t h i s . h d n P r e v D i v C l i e n t I d   =   h d n P r e v D i v C l i e n t I d ;  
         t h i s . h d n P r e v M u s i c I d e n t i f i e r s C l i e n t I d   =   h d n P r e v M u s i c I d e n t i f i e r s C l i e n t I d ;  
         t h i s . h d n N e x t M u s i c I d e n t i f i e r s C l i e n t I d   =   h d n N e x t M u s i c I d e n t i f i e r s C l i e n t I d ;  
         t h i s . u p D e t a i l s U n i q u e I D   =   u p D e t a i l s U n i q u e I D ;  
         t h i s . h f B e f o r e P l a y e d M u s i c C l i e n t I d   =   h f B e f o r e P l a y e d M u s i c C l i e n t I d ;  
 }  
  
 M u s i c . p r o t o t y p e   =   {  
  
         S h o w M u s i c :   f u n c t i o n ( m u s i c I d ,   d i v C l i e n t I d )   {  
                 / / w s t a w i a m   d o   h d n   i d   w y b r a n e j   m u z y k i  
                 $ ( " # "   +   t h i s . h d n M u s i c I d C l i e n t I d ) . v a l ( m u s i c I d ) ;  
                 / / d o d a n i e   k l a s y   c s s   d l a   w y b r a n e j   m u z y k i  
                 $ ( " # "   +   d i v C l i e n t I d ) . a d d C l a s s ( ' i t e m A c t i v e ' ) ;  
                 / / u s u n i e c i e   k l a s y   c s s   z   p o p r z e d n i o   w y b r a n e j   m u z y k i   ( j e s l i   b y l )  
                 i f   ( $ ( " # "   +   t h i s . h d n P r e v D i v C l i e n t I d ) . v a l ( )   ! =   n u l l )  
                         $ ( " # "   +   $ ( " # "   +   t h i s . h d n P r e v D i v C l i e n t I d ) . v a l ( ) ) . r e m o v e C l a s s ( ' i t e m A c t i v e ' ) ;  
                 / / z a p i s a n i e   d o   h d n   i d   d i v a   d l a   w y b r a n e g o   p l i k u  
                 $ ( " # "   +   t h i s . h d n P r e v D i v C l i e n t I d ) . v a l ( d i v C l i e n t I d ) ;  
  
                 v a r   e l e m e n t s   =   $ ( " # "   +   d i v C l i e n t I d ) . p a r e n t ( ) . c h i l d r e n ( " d i v . i t e m " ) ;  
                 v a r   c u r r e n t E l e m e n t I n d e x   =   0 ;  
                 v a r   p r e v i o u s M o v i e s I d e n t i f i e r s   =   ' ' ;  
                 v a r   n e x t M o v i e s I d e n t i f i e r s   =   ' ' ;  
                 e l e m e n t s . e a c h ( f u n c t i o n ( i )   {  
                         i f   ( t h i s . i d   = =   d i v C l i e n t I d )   {  
                                 c u r r e n t E l e m e n t I n d e x   =   i ;  
                                 r e t u r n   f a l s e ;  
                         }  
                 } ) ;  
                 i f   ( c u r r e n t E l e m e n t I n d e x   -   1   > =   0 )   {  
                         p r e v i o u s M o v i e s I d e n t i f i e r s   =   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   -   1 ] ) [ 0 ] . v a l u e ;  
                 }  
                 e l s e   {  
                         p r e v i o u s M o v i e s I d e n t i f i e r s   =   " ' n u l l ' " ;  
                 }  
                 / / e l e m e n t y   n a s t p n e  
                 i f   ( c u r r e n t E l e m e n t I n d e x   +   1   <   e l e m e n t s . l e n g t h )   {  
                         n e x t M o v i e s I d e n t i f i e r s   =   $ ( " i n p u t : h i d d e n " ,   e l e m e n t s [ c u r r e n t E l e m e n t I n d e x   +   1 ] ) [ 0 ] . v a l u e ;  
                 }  
                 e l s e   {  
                         n e x t M o v i e s I d e n t i f i e r s   =   " ' n u l l ' " ;  
                 }  
                 $ ( " # "   +   t h i s . h d n P r e v M u s i c I d e n t i f i e r s C l i e n t I d ) . v a l ( p r e v i o u s M o v i e s I d e n t i f i e r s ) ;  
                 $ ( " # "   +   t h i s . h d n N e x t M u s i c I d e n t i f i e r s C l i e n t I d ) . v a l ( n e x t M o v i e s I d e n t i f i e r s ) ;  
                 _ _ d o P o s t B a c k ( t h i s . u p D e t a i l s U n i q u e I D ,   ' ' ) ;  
         }  
 }  
  
 M u s i c . r e g i s t e r C l a s s ( ' M u s i c ' ,   M i l l i o n Y o u B a s e ) ;  
 R e g i s t e r   =   f u n c t i o n ( c b l S k i l s I d ,   c b R u l e s I d ,   c b N e w s l e t t e r I d ,   t b I d A r r a y ,   t b F a k e I d A r r a y ,   c o n f i r m T e x t )   {  
         R e g i s t e r . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . c b l S k i l s   =   " # "   +   c b l S k i l s I d ;  
         t h i s . c b R u l e s   =   " # "   +   c b R u l e s I d ;  
         t h i s . c b N e w s l e t t e   =   " # "   +   c b N e w s l e t t e r I d ;  
         t h i s . t b I d   =   t b I d A r r a y ;  
         t h i s . t b F a k e I d   =   t b F a k e I d A r r a y ;  
         t h i s . C o n f i r m T e x t   =   c o n f i r m T e x t ;  
 }  
  
 R e g i s t e r . p r o t o t y p e   =   {  
         / / w a l i d a c j a   d l u g o s c i   l o g i n u  
         C h e c k L o g i n L e n g t h :   f u n c t i o n ( s e n d e r ,   a r g s )   {  
                 v a r   l e n   =   a r g s . V a l u e . l e n g t h ;  
                 a r g s . I s V a l i d   =   l e n   >   1   & &   l e n   <   2 6 ;  
         } ,  
  
         / / w a l i d a c j a   d l u g o s c i   h a s Ba  
         C h e c k P a s s w o r d L e n g t h :   f u n c t i o n ( s e n d e r ,   a r g s )   {  
                 v a r   l e n   =   a r g s . V a l u e . l e n g t h ;  
                 a r g s . I s V a l i d   =   l e n   >   5   & &   l e n   <   1 6 ;  
         } ,  
  
         / / w a l i d a c j a   n a   i l o s c   z a z n a c z o n y c h   s k i l o w  
         C h e c k S k i l s C h e c k b o x L i s t :   f u n c t i o n ( s e n d e r ,   a r g s )   {  
                 v a r   n   =   $ ( t h i s . c b l S k i l s   +   "   i n p u t : c h e c k e d " ) . l e n g t h ;  
                 a r g s . I s V a l i d   =   n   >   0   & &   n   <   4 ;  
         } ,  
  
         / / w a l i d a c j a   c z y   z a z n a c z o n o   r e g u l a m i n  
         C h e c k R u l e s C h e c k e d :   f u n c t i o n ( s e n d e r ,   a r g s )   {  
                 a r g s . I s V a l i d   =   $ ( t h i s . c b R u l e s ) . a t t r ( " c h e c k e d " ) ;  
         } ,  
  
         / / w a l i d a c j a   c z y   z a z n a c z o n o   z g o d e   n a   m a i l i n g  
         C h e c k N e w s l e t t e r C h e c k e d :   f u n c t i o n ( s e n d e r ,   a r g s )   {  
                 a r g s . I s V a l i d   =   $ ( t h i s . c b N e w s l e t t e ) . a t t r ( " c h e c k e d " ) ;  
         } ,  
  
         S h o w H i n t :   f u n c t i o n ( d i v I d )   {  
                 v a r   d i v   =   $ ( " # "   +   d i v I d ) ;  
                 d i v . s h o w ( ) ;  
         } ,  
  
         H i d e H i n t :   f u n c t i o n ( d i v I d )   {  
                 v a r   d i v   =   $ ( " # "   +   d i v I d ) ;  
                 d i v . h i d e ( ) ;  
         } ,  
  
         L o a d A l l T e x t B o x :   f u n c t i o n ( )   {  
                 f o r   ( i   =   0 ;   i   <   t h i s . t b I d . l e n g t h ;   i + + )  
                         t h i s . T b L o a d ( i ) ;  
         } ,  
  
         T b L o a d :   f u n c t i o n ( t b I n d e x )   {  
                 v a r   i s R e a l E m p t y   =   ( $ ( " # "   +   t h i s . t b I d [ t b I n d e x ] ) . v a l ( )   = =   ' ' ) ;  
                 i f   ( i s R e a l E m p t y )   {  
                         $ ( " # "   +   t h i s . t b I d [ t b I n d e x ] ) . h i d e ( ) ;  
                         $ ( " # "   +   t h i s . t b F a k e I d [ t b I n d e x ] ) . s h o w ( ) ;  
                 }  
                 e l s e   {  
                         $ ( " # "   +   t h i s . t b I d [ t b I n d e x ] ) . s h o w ( ) ;  
                         $ ( " # "   +   t h i s . t b F a k e I d [ t b I n d e x ] ) . h i d e ( ) ;  
                 }  
         } ,  
  
         T b F o c u s :   f u n c t i o n ( t b I n d e x )   {  
                 $ ( " # "   +   t h i s . t b F a k e I d [ t b I n d e x ] ) . h i d e ( ) ;  
                 $ ( " # "   +   t h i s . t b I d [ t b I n d e x ] ) . s h o w ( ) ;  
                 $ ( " # "   +   t h i s . t b I d [ t b I n d e x ] ) . f o c u s ( ) ;  
         } ,  
  
         T b B l u r :   f u n c t i o n ( t b I n d e x )   {  
                 i f   ( $ ( " # "   +   t h i s . t b I d [ t b I n d e x ] ) . v a l ( )   = =   ' ' )   {  
                         $ ( " # "   +   t h i s . t b F a k e I d [ t b I n d e x ] ) . s h o w ( ) ;  
                         $ ( " # "   +   t h i s . t b I d [ t b I n d e x ] ) . h i d e ( ) ;  
                 }  
         } ,  
  
         T o g g l e S k i l l s C h e c k b o x :   f u n c t i o n ( )   {  
                 v a r   n   =   $ ( t h i s . c b l S k i l s   +   "   i n p u t : c h e c k e d " ) . l e n g t h ;  
                 i f   ( n   >   2 )  
                         $ ( t h i s . c b l S k i l s   +   "   i n p u t : n o t ( : c h e c k e d ) " ) . a t t r ( " d i s a b l e d " ,   " d i s a b l e d " ) ;  
                 e l s e  
                         $ ( t h i s . c b l S k i l s   +   "   i n p u t : n o t ( : c h e c k e d ) " ) . r e m o v e A t t r ( " d i s a b l e d " ) ;  
         } ,  
  
         s h o w C o n f i r m :   f u n c t i o n ( b u t t o n I D )   {  
                 $ . p r o m p t ( t h i s . C o n f i r m T e x t ,   {   c a l l b a c k :   f u n c t i o n ( v ,   m ,   f )   {   i f   ( v )   {   $ ( " # "   +   b u t t o n I D ) . c l i c k ( ) ;   r e t u r n   t r u e ;   }   } ,   b u t t o n s :   b t n s ,   f o c u s :   1   } ) ;  
                 r e t u r n   f a l s e ;  
         }  
 }  
 R e g i s t e r . r e g i s t e r C l a s s ( ' R e g i s t e r ' ,   M i l l i o n Y o u B a s e ) ;  
 P h o t o s   =   f u n c t i o n ( c o n f i r m T e x t )   {  
         P h o t o s . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . C o n f i r m T e x t   =   c o n f i r m T e x t ;  
 }  
  
 P h o t o s . p r o t o t y p e   =   {  
  
         s h o w E d i t M o d e :   f u n c t i o n ( e d i t M o d e I d ,   v i e w M o d e I d )   {  
                 $ ( ' # '   +   e d i t M o d e I d ) . s h o w ( ) ;  
                 $ ( ' # '   +   v i e w M o d e I d ) . h i d e ( ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         c a n c e l :   f u n c t i o n ( e d i t M o d e I d ,   v i e w M o d e I d )   {  
                 $ ( ' # '   +   e d i t M o d e I d ) . h i d e ( ) ;  
                 $ ( ' # '   +   v i e w M o d e I d ) . s h o w ( ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         s h o w C o n f i r m :   f u n c t i o n ( b u t t o n I D )   {  
                 $ . p r o m p t ( t h i s . C o n f i r m T e x t ,   {   c a l l b a c k :   f u n c t i o n ( v ,   m ,   f )   {   i f   ( v )   {   $ ( " # "   +   b u t t o n I D ) . c l i c k ( ) ;   r e t u r n   t r u e ;   }   } ,   b u t t o n s :   b t n s ,   f o c u s :   1   } ) ;  
                 r e t u r n   f a l s e ;  
         }  
 }  
 P h o t o s . r e g i s t e r C l a s s ( ' P h o t o s ' ,   M i l l i o n Y o u B a s e ) ;  
 A d d B l o g P o s t   =   f u n c t i o n ( f c k B l o g P o s t I d ,   d d l M o v i e s I d ,   d d l M u s i c I d ,   d d l S c e n a r i o I d )   {  
         A d d B l o g P o s t . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . f c k B l o g P o s t   =   f c k B l o g P o s t I d ;  
         t h i s . d d l M o v i e s   =   ' # '   +   d d l M o v i e s I d ;  
         t h i s . d d l M u s i c   =   ' # '   + d d l M u s i c I d ;  
         t h i s . d d l S c e n a r i o   =   ' # '   + d d l S c e n a r i o I d ;  
 }  
  
 A d d B l o g P o s t . p r o t o t y p e   =   {  
  
         H i d e H i n t s :   f u n c t i o n   ( )   {  
                 $ ( " # h i n t M u s i c " ) . h i d e ( ) ;  
                 $ ( " # h i n t M o v i e " ) . h i d e ( ) ;  
                 $ ( " # h i n t S c e n a r i o " ) . h i d e ( ) ;  
         } ,  
  
         I n s e r t M o v i e T a g :   f u n c t i o n   ( )   {                  
                 v a r   s e l e c t e d V a l u e   =   $ ( t h i s . d d l M o v i e s ) . v a l ( ) ;  
                 i f   ( s e l e c t e d V a l u e   ! =   ' 0 ' )   {  
                         F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . F o c u s ( ) ;  
                         v a r   e x p r e s s i o n   =   " [ \ \ S \ \ s ] * \ \ [ m o v i e \ \ ] \ \ s * "   +   s e l e c t e d V a l u e   +   " \ \ s * \ \ [ / m o v i e \ \ ] [ \ \ S \ \ s ] * " ;                          
                         v a r   r e g e x   =   n e w   R e g E x p ( e x p r e s s i o n ) ;                          
                         v a r   t e x t   =   F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . G e t D a t a ( t r u e ) ;                          
                         i f   ( ! r e g e x . t e s t ( t e x t ) )   {                                  
                                 F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . I n s e r t H t m l ( ' [ m o v i e ] '   +   s e l e c t e d V a l u e   +   ' [ / m o v i e ] ' ) ;  
                                 t h i s . H i d e H i n t s ( ) ;  
                         }  
                         e l s e   {                                  
                                 $ ( " # h i n t M o v i e " ) . s h o w ( ) ;  
                         }  
                 }                  
                 $ ( t h i s . d d l M o v i e s ) . v a l ( ' 0 ' ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         I n s e r t M u s i c T a g :   f u n c t i o n   ( )   {  
                 v a r   s e l e c t e d V a l u e   =   $ ( t h i s . d d l M u s i c ) . v a l ( ) ;  
                 i f   ( s e l e c t e d V a l u e   ! =   ' 0 ' )   {  
                         F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . F o c u s ( ) ;  
  
                         v a r   e x p r e s s i o n   =   " [ \ \ S \ \ s ] * \ \ [ m u s i c \ \ ] \ \ s * "   +   s e l e c t e d V a l u e   +   " \ \ s * \ \ [ / m u s i c \ \ ] [ \ \ S \ \ s ] * " ;  
                         v a r   r e g e x   =   n e w   R e g E x p ( e x p r e s s i o n ) ;  
                         v a r   t e x t   =   F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . G e t D a t a ( t r u e ) ;  
                         i f   ( ! r e g e x . t e s t ( ) )   {  
                                 F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . I n s e r t H t m l ( ' [ m u s i c ] '   +   s e l e c t e d V a l u e   +   ' [ / m u s i c ] ' ) ;  
                                 t h i s . H i d e H i n t s ( ) ;  
                         }  
                         e l s e   {  
                                 $ ( " # h i n t M u s i c " ) . s h o w ( ) ;  
                         }  
                 }  
                 $ ( t h i s . d d l M u s i c ) . v a l ( ' 0 ' ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         I n s e r t S c e n a r i o T a g :   f u n c t i o n   ( )   {  
                 v a r   s e l e c t e d V a l u e   =   $ ( t h i s . d d l S c e n a r i o ) . v a l ( ) ;  
                 i f   ( s e l e c t e d V a l u e   ! =   ' 0 ' )   {  
                         F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . F o c u s ( ) ;  
  
                         v a r   e x p r e s s i o n   =   " [ \ \ S \ \ s ] * \ \ [ s c e n a r i o \ \ ] \ \ s * "   +   s e l e c t e d V a l u e   +   " \ \ s * \ \ [ / s c e n a r i o \ \ ] [ \ \ S \ \ s ] * " ;  
                         v a r   r e g e x   =   n e w   R e g E x p ( e x p r e s s i o n ) ;  
                         v a r   t e x t   =   F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . G e t D a t a ( t r u e ) ;  
                         i f   ( ! r e g e x . t e s t ( ) )   {  
                                 F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . I n s e r t H t m l ( ' [ s c e n a r i o ] '   +   s e l e c t e d V a l u e   +   ' [ / s c e n a r i o ] ' ) ;  
                                 t h i s . H i d e H i n t s ( ) ;  
                         }  
                         e l s e   {  
                                 $ ( " # h i n t S c e n a r i o " ) . s h o w ( ) ;  
                         }  
                 }  
                 $ ( t h i s . d d l S c e n a r i o ) . v a l ( ' 0 ' ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         V a l i d a t e F c k E d i t o r :   f u n c t i o n   ( )   {  
                 v a r   p a g e V a l i d   =   P a g e _ C l i e n t V a l i d a t e ( ' b l o g ' ) ;  
                 v a r   f c k V a l i d ;  
                 v a r   s t r F C K E d i t o r T e x t L e n g t h   =   t h i s . G e t F c k E d i t o r P l a i n T e x t L e n g t h ( t h i s . f c k B l o g P o s t ) ;  
                 i f   ( s t r F C K E d i t o r T e x t L e n g t h   > =   2   & &   s t r F C K E d i t o r T e x t L e n g t h   < =   5 0 0 0 )   {  
                         f c k V a l i d   =   t r u e ;  
                         $ ( " # f c k E r r o r " ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                 }  
                 e l s e   {  
                         $ ( " # f c k E r r o r " ) . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
                         f c k V a l i d   =   f a l s e ;  
                 }  
  
                 r e t u r n   ( f c k V a l i d   & &   p a g e V a l i d ) ;  
         }  
  
  
 }  
 A d d B l o g P o s t . r e g i s t e r C l a s s ( ' A d d B l o g P o s t ' ,   M i l l i o n Y o u B a s e ) ;  
 B l o g P o s t   =   f u n c t i o n ( f c k B l o g P o s t I d ,   d i v E d i t P o s t I d ,   d i v E d i t B u t t o n s I d ,   d i v V i e w P o s t I d ,   c o n f i r m T e x t ,   d d l M o v i e s I d ,   d d l M u s i c I d ,   d d l S c e n a r i o I d )   {  
         B l o g P o s t . i n i t i a l i z e B a s e ( t h i s ) ;  
         t h i s . d i v E d i t P o s t   =   " # "   +   d i v E d i t P o s t I d ;  
         t h i s . d i v E d i t B u t t o n s   =   " # "   +   d i v E d i t B u t t o n s I d ;  
         t h i s . d i v V i e w P o s t   =   " # "   +   d i v V i e w P o s t I d ;  
         t h i s . f c k B l o g P o s t   =   f c k B l o g P o s t I d ;  
         t h i s . c o n f i r m T e x t   =   c o n f i r m T e x t ;  
         t h i s . d d l M o v i e s   =   " # "   +   d d l M o v i e s I d ;  
         t h i s . d d l M u s i c   =   " # "   +   d d l M u s i c I d ;  
         t h i s . d d l S c e n a r i o   =   " # "   +   d d l S c e n a r i o I d ;  
 }  
  
 B l o g P o s t . p r o t o t y p e   =   {  
  
         V a l i d a t e F c k E d i t o r :   f u n c t i o n ( )   {  
                 v a r   p a g e V a l i d   =   P a g e _ C l i e n t V a l i d a t e ( ' b l o g ' ) ;  
                 v a r   f c k V a l i d ;  
                 v a r   s t r F C K E d i t o r T e x t L e n g t h   =   t h i s . G e t F c k E d i t o r P l a i n T e x t L e n g t h ( t h i s . f c k B l o g P o s t ) ;  
                 i f   ( s t r F C K E d i t o r T e x t L e n g t h   > =   2   & &   s t r F C K E d i t o r T e x t L e n g t h   < =   5 0 0 0 )   {  
                         f c k V a l i d   =   t r u e ;  
                         $ ( " # f c k E r r o r " ) . c s s ( " d i s p l a y " ,   " n o n e " ) ;  
                 }  
                 e l s e   {  
                         $ ( " # f c k E r r o r " ) . c s s ( " d i s p l a y " ,   " b l o c k " ) ;  
                         f c k V a l i d   =   f a l s e ;  
                 }  
  
                 r e t u r n   ( f c k V a l i d   & &   p a g e V a l i d ) ;  
         } ,  
  
         s h o w E d i t M o d e :   f u n c t i o n ( )   {  
                 $ ( t h i s . d i v E d i t P o s t ) . s h o w ( ) ;  
                 $ ( t h i s . d i v E d i t B u t t o n s ) . h i d e ( ) ;  
                 $ ( t h i s . d i v V i e w P o s t ) . h i d e ( ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         h i d e E d i t M o d e :   f u n c t i o n ( )   {  
                 $ ( t h i s . d i v E d i t P o s t ) . h i d e ( ) ;  
                 $ ( t h i s . d i v E d i t B u t t o n s ) . s h o w ( ) ;  
                 $ ( t h i s . d i v V i e w P o s t ) . s h o w ( ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         H i d e H i n t s :   f u n c t i o n ( )   {  
                 $ ( " # h i n t M u s i c " ) . h i d e ( ) ;  
                 $ ( " # h i n t M o v i e " ) . h i d e ( ) ;  
                 $ ( " # h i n t S c e n a r i o " ) . h i d e ( ) ;  
         } ,  
  
         I n s e r t M o v i e T a g :   f u n c t i o n ( )   {  
                 v a r   s e l e c t e d V a l u e   =   $ ( t h i s . d d l M o v i e s ) . v a l ( ) ;  
                 i f   ( s e l e c t e d V a l u e   ! =   ' 0 ' )   {  
                         F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . F o c u s ( ) ;  
  
                         v a r   e x p r e s s i o n   =   " [ \ \ S \ \ s ] * \ \ [ m o v i e \ \ ] \ \ s * "   +   s e l e c t e d V a l u e   +   " \ \ s * \ \ [ / m o v i e \ \ ] [ \ \ S \ \ s ] * " ;  
                         v a r   r e g e x   =   n e w   R e g E x p ( e x p r e s s i o n ) ;  
                         v a r   t e x t   =   F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . G e t D a t a ( t r u e ) ;  
                         i f   ( ! r e g e x . t e s t ( t e x t ) )   {  
                                 F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . I n s e r t H t m l ( ' [ m o v i e ] '   +   s e l e c t e d V a l u e   +   ' [ / m o v i e ] ' ) ;  
                                 t h i s . H i d e H i n t s ( ) ;  
                         }  
                         e l s e   {  
                                 $ ( " # h i n t M o v i e " ) . s h o w ( ) ;  
                         }  
                 }  
                 $ ( t h i s . d d l M o v i e s ) . v a l ( ' 0 ' ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         I n s e r t M u s i c T a g :   f u n c t i o n ( )   {  
                 v a r   s e l e c t e d V a l u e   =   $ ( t h i s . d d l M u s i c ) . v a l ( ) ;  
                 i f   ( s e l e c t e d V a l u e   ! =   ' 0 ' )   {  
                         F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . F o c u s ( ) ;  
  
                         v a r   e x p r e s s i o n   =   " [ \ \ S \ \ s ] * \ \ [ m u s i c \ \ ] \ \ s * "   +   s e l e c t e d V a l u e   +   " \ \ s * \ \ [ / m u s i c \ \ ] [ \ \ S \ \ s ] * " ;  
                         v a r   r e g e x   =   n e w   R e g E x p ( e x p r e s s i o n ) ;  
                         v a r   t e x t   =   F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . G e t D a t a ( t r u e ) ;  
                         i f   ( ! r e g e x . t e s t ( ) )   {  
                                 F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . I n s e r t H t m l ( ' [ m u s i c ] '   +   s e l e c t e d V a l u e   +   ' [ / m u s i c ] ' ) ;  
                                 t h i s . H i d e H i n t s ( ) ;  
                         }  
                         e l s e   {  
                                 $ ( " # h i n t M u s i c " ) . s h o w ( ) ;  
                         }  
                 }  
                 $ ( t h i s . d d l M u s i c ) . v a l ( ' 0 ' ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         I n s e r t S c e n a r i o T a g :   f u n c t i o n ( )   {  
                 v a r   s e l e c t e d V a l u e   =   $ ( t h i s . d d l S c e n a r i o ) . v a l ( ) ;  
                 i f   ( s e l e c t e d V a l u e   ! =   ' 0 ' )   {  
                         F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . F o c u s ( ) ;  
  
                         v a r   e x p r e s s i o n   =   " [ \ \ S \ \ s ] * \ \ [ s c e n a r i o \ \ ] \ \ s * "   +   s e l e c t e d V a l u e   +   " \ \ s * \ \ [ / s c e n a r i o \ \ ] [ \ \ S \ \ s ] * " ;  
                         v a r   r e g e x   =   n e w   R e g E x p ( e x p r e s s i o n ) ;  
                         v a r   t e x t   =   F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . G e t D a t a ( t r u e ) ;  
                         i f   ( ! r e g e x . t e s t ( ) )   {  
                                 F C K e d i t o r A P I . G e t I n s t a n c e ( t h i s . f c k B l o g P o s t ) . I n s e r t H t m l ( ' [ s c e n a r i o ] '   +   s e l e c t e d V a l u e   +   ' [ / s c e n a r i o ] ' ) ;  
                                 t h i s . H i d e H i n t s ( ) ;  
                         }  
                         e l s e   {  
                                 $ ( " # h i n t S c e n a r i o " ) . s h o w ( ) ;  
                         }  
                 }  
                 $ ( t h i s . d d l S c e n a r i o ) . v a l ( ' 0 ' ) ;  
                 r e t u r n   f a l s e ;  
         } ,  
  
         c o n f i r m D e l e t e :   f u n c t i o n ( )   {  
                 r e t u r n   c o n f i r m ( t h i s . c o n f i r m T e x t )  
         }  
 }  
 B l o g P o s t . r e g i s t e r C l a s s ( ' B l o g P o s t ' ,   M i l l i o n Y o u B a s e ) ;  
  
 
