ÿþ/ * * 
   *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
   *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
   *   s k a n . c h   w e b s i t e   b e h a v i o r . 
   * 
   *   @ a u t h o r   s t e f a n   k l o i b e r ,   < s t k @ c o m a . d e > 
   *   @ d a t e   2 0 0 8 - 0 8 
   * 
   *   @ v e r s i o n   0 . 1 0 
   * 
   * 
   *   @ t e s t e d   F i r e f o x   3 . 0 . 1 ,   I E   6 . 0 . 2 ,   O p e r a   9 . 5 ,   S a f a r i   3 . 1 . 2   ( P C ) 
   *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
   *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
   * / 
 
 
 
 / *   d e f i n e   n a m e s p a c e   * / 
 v a r   c m ;   / /   d e c l a r e s   a   g l o b a l   s y m b o l 
 i f   ( ! c m )   c m   =   { } ; 
         e l s e   i f   ( t y p e o f   c m   ! =   ' o b j e c t ' ) 
                 t h r o w   n e w   E r r o r ( ' c m   e x i s t i e r t   b e r e i t s ,   i s t   a b e r   k e i n   o b j e k t ! ' ) ; 
 
 
 / * * 
   *   c u s t o m i z e d   f o r m 
   * / 
 c m . c f   = 
 { 
       / * * 
         *   c u s t o m i z e d   s e l e c t   f o r m 
         * / 
         s e l e c t   : 
         { 
                 t i m e o u t I d   :   f a l s e , 
 
                 t o g g l e L i s t   :   f u n c t i o n ( e v ) 
                 { 
                         j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t _ b t n ' ) . a d d C l a s s ( ' a c t i v e ' ) ; 
                         / /   t o g g l e 
                         j Q u e r y ( ' d i v # l a n g _ s e l e c t   u l ' ) . s l i d e T o g g l e ( 1 , f u n c t i o n ( ) 
                         { 
                                 i f   ( j Q u e r y ( ' d i v # l a n g _ s e l e c t   u l : v i s i b l e ' ) . l e n g t h   >   0 ) 
                                 { 
                                         j Q u e r y ( ' d i v # l a n g _ s e l e c t ' ) . h o v e r ( 
                                         / /   o v e r 
                                         f u n c t i o n ( ) 
                                         { 
                                                 i f   ( c m . c f . s e l e c t . t i m e o u t I d   ! = =   f a l s e ) 
                                                 { 
                                                         c l e a r T i m e o u t ( c m . c f . s e l e c t . t i m e o u t I d ) ; 
                                                         c m . c f . s e l e c t . t i m e o u t I d   =   f a l s e ; 
                                                 } 
                                         } , 
                                         / /   o u t 
                                         f u n c t i o n ( ) 
                                         { 
                                                 c m . c f . s e l e c t . t i m e o u t I d   =   s e t T i m e o u t ( " j Q u e r y ( ' d i v # l a n g _ s e l e c t   u l ' ) . s l i d e U p ( 1 , f u n c t i o n ( ) { j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t _ b t n ' ) . r e m o v e C l a s s ( ' a c t i v e ' ) ; } ) " ,   1 0 0 0 ) ; 
                                         } ) ; 
 
                                         / /   c l i c k   l i s t   e l e m e n t 
                                         j Q u e r y ( ' d i v # l a n g _ s e l e c t   u l   l i   a ' ) . c l i c k ( c m . c f . s e l e c t . c h a n g e V a l u e ) ; 
                                 } 
                         } ) ; 
                 } , 
 
                 c h a n g e V a l u e   :   f u n c t i o n ( e v ) 
                 { 
                         / / e v . p r e v e n t D e f a u l t ( ) ;   / /   p r e v e n t s   t h e   b r o w s e r   f r o m   e x e c u t i n g   t h e   d e f a u l t   a c t i o n 
                         j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t e d ' ) . h t m l ( j Q u e r y ( t h i s ) . t e x t ( ) ) ; 
                         j Q u e r y ( ' i n p u t # l a n g _ s e l e c t e d _ v a l u e ' ) . v a l ( j Q u e r y ( t h i s ) . t e x t ( ) ) ; 
                         j Q u e r y ( ' d i v # l a n g _ s e l e c t   u l ' ) . s l i d e U p ( 1 , f u n c t i o n ( ) { j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t _ b t n ' ) . r e m o v e C l a s s ( ' a c t i v e ' ) ; } ) ; 
                         c l e a r T i m e o u t ( c m . c f . s e l e c t . t i m e o u t I d ) ; 
                 } 
         } , 
 
       / * * 
         *   c u s t o m i z e d   s e a r c h   b o x 
         * / 
         s e a r c h   : 
         { 
                 d e f a u l t V a l u e   :   " S u c h b e g r i f f " , 
                 s e t D e f a u l t V a l u e   :   f u n c t i o n ( ) 
                 { 
                         v a r   s e l e c t e d L a n g   =   j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t e d ' ) . t e x t ( ) ; 
                         j Q u e r y . a j a x ( { 
                                 u r l : ' f i l e a d m i n / r e s o u r c e s / b e h a v i o r / l o c a l l a n g . x m l ' , 
                                 d a t a T y p e : ' x m l ' , 
                                 s u c c e s s :   f u n c t i o n ( x m l )   { 
                                         c m . c f . s e a r c h . d e f a u l t V a l u e   =   j Q u e r y ( ' T 3 l o c a l l a n g   d a t a   l a n g u a g e K e y [ i n d e x = '   + s e l e c t e d L a n g +   ' ]   l a b e l [ i n d e x = s e a r c h V a l u e ] ' , x m l ) . t e x t ( ) ; 
                                         j Q u e r y ( ' i n p u t # s e a r c h _ i n p u t ' ) . v a l ( c m . c f . s e a r c h . d e f a u l t V a l u e ) ; 
                                 } 
                         } ) ; 
                 } , 
                 c l e a r D e f a u l t   :   f u n c t i o n ( ) 
                 { 
                         i f   ( j Q u e r y ( t h i s ) . v a l ( )   = = =   c m . c f . s e a r c h . d e f a u l t V a l u e ) 
                         { 
                                 j Q u e r y ( t h i s ) . v a l ( ' ' ) . a d d C l a s s ( ' a c t i v e ' ) ; 
                         } 
                         j Q u e r y ( t h i s ) . b l u r ( f u n c t i o n ( e v ) 
                         { 
                                 i f   ( j Q u e r y ( t h i s ) . v a l ( )   = = =   " " ) 
                                 { 
                                         j Q u e r y ( t h i s ) . v a l ( c m . c f . s e a r c h . d e f a u l t V a l u e ) . r e m o v e C l a s s ( ' a c t i v e ' ) ; 
                                 } 
                         } ) ; 
                 } 
         } , 
 
       / * * 
         *   i n i t i a l i z e   c u s t o m i z e d   f o r m s 
         * / 
         i n i t   :   f u n c t i o n ( ) 
         { 
                 j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t e d ,   d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t _ b t n ' ) . h o v e r 
                 ( 
                         f u n c t i o n ( ) { 
                                 j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t _ b t n ' ) . a d d C l a s s ( ' h o v e r ' ) ;   } ,   
                         f u n c t i o n ( ) { 
                                 j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t _ b t n ' ) . r e m o v e C l a s s ( ' h o v e r ' ) ;   } 
                 ) ; 
                 j Q u e r y ( ' d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t e d ,   d i v # l a n g _ s e l e c t i o n   d i v . s e l e c t _ b t n ' ) . c l i c k ( t h i s . s e l e c t . t o g g l e L i s t ) ; 
                 t h i s . s e a r c h . s e t D e f a u l t V a l u e ( ) ; 
                 j Q u e r y ( ' i n p u t # s e a r c h _ i n p u t ' ) . f o c u s ( c m . c f . s e a r c h . c l e a r D e f a u l t ) ; 
                 j Q u e r y ( ' d i v # s e a r c h _ s u b m i t ' ) . c l i c k ( f u n c t i o n ( e v )   {   j Q u e r y ( ' f o r m # s e a r c h _ f o r m ' ) . s u b m i t ( ) ;   } ) ; 
         } 
 } ; 
 
 
 c m . a p p F o r m   =   f u n c t i o n ( )   { 
 	 v a r   a p p A s   =   j Q u e r y ( ' f o r m # f o r m _ o f f e r   s e l e c t # a p p l i c a t i o n _ a s ' ) , 
 	 	 a p p F o r   =   j Q u e r y ( ' f o r m # f o r m _ o f f e r   s e l e c t # a p p l i c a t i o n _ f o r ' ) ; 
 	 i f   ( a p p A s . l e n g t h   >   0 )   { 
 	 	 / /   i n i t i a l   o n   p a g e   l o a d 
 	 	 i f   ( a p p A s . v a l ( )   = = =   " I n i t i a t i v b e w e r b u n g " )   { 
 	 	 	 a p p F o r . a t t r ( ' d i s a b l e d ' , ' ' ) ; 
 	 	 } 
 	 	 / /   o n   c h a n g e 
 	 	 a p p A s . c h a n g e ( f u n c t i o n ( e v e n t )   { 
 	 	 	 i f   ( j Q u e r y ( t h i s ) . v a l ( )   = = =   " I n i t i a t i v b e w e r b u n g " )   { 
 	 	 	 	 a p p F o r . a t t r ( ' d i s a b l e d ' , ' ' ) ; 
 	 	 	 } 
 	 	 	 e l s e   { 
 	 	 	 	 a p p F o r . a t t r ( ' d i s a b l e d ' , ' d i s a b l e d ' ) ; 
 	 	 	 } 
 	 	 } ) ; 
 	 } 
 } 
 
 
 c m . z e b r a S t r i p e s   =   f u n c t i o n ( )   { 
         j Q u e r y ( ' d i v . t x - i n d e x e d s e a r c h - r e s   d i v : o d d ' ) . a d d C l a s s ( ' e v e n ' ) ; 
         j Q u e r y ( ' d i v . t x - i n d e x e d s e a r c h - r e s   d i v : e v e n ' ) . a d d C l a s s ( ' o d d ' ) ; 
         
 } 
 
 
 / * * 
   *   t h i n g s   t o   d o   w h e n   t h e   d o m   i s   a v a i l a b l e 
   * / 
 j Q u e r y ( d o c u m e n t ) . r e a d y ( f u n c t i o n ( ) 
 { 
         / /   a v o i d   t h e   o u t l i n e   t h a t   a p p e a r s   a r o u n d   l i n k s   u p o n   c l i c k i n g   
         / /   t h e m   a n d   m a k e   t h e m   a c t i v e .   u s e d   f o r   i e . 
         j Q u e r y ( ' a ' ) . c l i c k ( f u n c t i o n ( )   {   t h i s . b l u r ( ) ;   } ) ; 
 
         / /   i e   6   c s s   h a c k s 
         j Q u e r y ( ' d i v # m a i n   d i v . w r a p p e r > h 2 ' ) . c s s ( ' m a r g i n ' ,   ' 0   1 0 p x ' ) ; 
         j Q u e r y ( ' d i v . t x - i n d e x e d s e a r c h - b r o w s e b o x   u l . b r o w s e b o x   l i : f i r s t - c h i l d ' ) . c s s ( ' b o r d e r - l e f t ' , ' 0   n o n e ' ) ; 
 
         / /   i n i t i a t e   c u s t o m i z e d   s e l e c t   b o x 
         c m . c f . i n i t ( ) ; 
 	 
 	 / /   a p p l i c a t i o n   f o r m   b e h a v i o r 
 	 c m . a p p F o r m ( ) ; 
 
         / /   z e b r a   s t r i p e   t h e   s e a r c h   r e s u l t s 
         c m . z e b r a S t r i p e s ( ) ; 
 } ) ; 
 
 
