ÿþ/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /  
 v a r   C o m m o n   =   {  
 	 C o o k i e : {  
 	 	 s e t   :   f u n c t i o n ( s N a m e ,   s V a l u e ,   s P a t h ,   s E x p i r e )   {  
 	 	 	 d o c u m e n t . c o o k i e   =   s N a m e   +   ' = '   +   ( w i n d o w . e n c o d e U R I ?   e n c o d e U R I ( s V a l u e )   :   e s c a p e ( s V a l u e ) )   +  
 	 	 	 	 ( ( s E x p i r e   = =   n u l l ) ?   ' '   :   ( ' ;   e x p i r e s = '   +   s E x p i r e . t o G M T S t r i n g ( ) ) )   +  
 	 	 	 	 ( ( s P a t h   = =   n u l l ) ?   ' '   :   ( ' ;   p a t h = '   +   s P a t h ) ) ;  
 	 	 } ,  
 	 	 g e t   :   f u n c t i o n ( s N a m e )   {  
 	 	 	 v a r   s S e a r c h   =   s N a m e   +   ' = ' ;  
 	 	 	 i f ( d o c u m e n t . c o o k i e . l e n g t h   >   0 )   {  
 	 	 	 	 v a r   i O f f s e t   =   d o c u m e n t . c o o k i e . i n d e x O f ( s S e a r c h ) ;  
 	 	 	 	 i f ( i O f f s e t   ! =   - 1 )   {  
 	 	 	 	 	 i O f f s e t   + =   s S e a r c h . l e n g t h ;  
 	 	 	 	 	 v a r   i E n d   =   d o c u m e n t . c o o k i e . i n d e x O f ( ' ; ' ,   i O f f s e t ) ;  
 	 	 	 	 	 i f ( i E n d   = =   - 1 )   {  
 	 	 	 	 	 	 i E n d   =   d o c u m e n t . c o o k i e . l e n g t h ;  
 	 	 	 	 	 }  
 	 	 	 	 	 r e t u r n   w i n d o w . d e c o d e U R I ?  
 	 	 	 	 	 	 d e c o d e U R I ( d o c u m e n t . c o o k i e . s u b s t r i n g ( i O f f s e t ,   i E n d ) ) :  
 	 	 	 	 	 	 u n e s c a p e ( d o c u m e n t . c o o k i e . s u b s t r i n g ( i O f f s e t ,   i E n d ) ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 r e t u r n   ' ' ;  
 	 	 }  
 	 }  
 } ;  
  
 / / f u n c t i o n   s h o w P r o p e r t y ( i d ) {  
 / / 	 v a r   f l a g = f a l s e ;  
 / / 	 v a r   s t r = ' ' ;  
 / / 	 v a r   p r = ' ' ;  
 / / 	 v a r   d i v _ b l o c k = $ ( ' # d i v _ ' ) ;  
 / / 	 $ ( ' . c h e k ' ) . e a c h ( f u n c t i o n ( ) {  
 / / 	 	 i f ( t h i s . c h e c k e d ) {  
 / / 	 	 	 f l a g   =   t r u e ;  
 / / 	 	 	 i f ( s t r ! = ' ' ) { p r = ' , ' }  
 / / 	 	 	 s t r = s t r + p r + $ ( t h i s ) . a t t r ( ' n u m b e r ' )  
 / / 	 	 } ;  
 / / 	 } ) ;  
 / / 	 $ ( ' # g o o d s l i s t ' ) . v a l ( s t r ) ;  
 / / 	 i f ( f l a g = = t r u e ) { d i v _ b l o c k . s h o w ( ) } e l s e { d i v _ b l o c k . h i d e ( ) }  
 / / }  
  
 f u n c t i o n   b a s k e t G o o d s ( i d ) {  
 	 v a r   b a s k e t _ b l o c k = $ ( ' # b a s k e t _ b l o c k ' ) ;  
 	 v a r   d a t a   =   {  
 	 	 w h a t : ' c h a n g e ' ,  
 	 	 i d :   i d ,  
 	 	 c o u n t :   $ ( ' # c o u n t _ ' + i d ) . v a l ( )  
 	 } ;  
 	 i f ( d a t a . c o u n t = = p a r s e I n t ( M a t h . a b s ( d a t a . c o u n t ) ) ) {  
 	 	 i f ( d a t a . c o u n t ! = 0 ) {  
 	 	 	 $ . g e t J S O N ( ' / b a s k e t / b a s k e t . h t m l ' ,   d a t a ,   f u n c t i o n ( j s o n ) {  
 	 	 	 	 i f ( j s o n . b a s k e t _ c o u n t = = 0 ) {  
 	 	 	 	 	 b a s k e t _ b l o c k . h i d e ( ) ;  
 	 	 	 	 	 $ ( ' # b a s k e t _ c o u n t ' ) . h t m l ( ' 0 ' ) ;  
 	 	 	 	 	 $ ( ' # b a s k e t _ p a y ' ) . h t m l ( ' 0 ' ) ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 b a s k e t _ b l o c k . s h o w ( )  
 	 	 	 	 	 $ ( ' # b a s k e t _ c o u n t ' ) . h t m l ( j s o n . b a s k e t _ c o u n t ) ;  
 	 	 	 	 	 $ ( ' # b a s k e t _ p a y ' ) . h t m l ( j s o n . b a s k e t _ p r i c e ) ;  
 	 	 	 	 }  
 	 	 	 	 i f ( j s o n . r e s u l t = = ' c h a n g e ' ) {  
 	 	 	 	 	 $ ( ' # c o u n t _ ' + i d ) . a t t r ( ' c l a s s ' , ' b a s k e t ' ) ;  
 	 	 	 	 	 $ ( ' # a _ ' + i d ) . h t m l ( ' 7<5=8BL' ) ;  
 	 	 	 	 	 $ ( ' # i n p _ ' + i d ) . v a l ( ' 7<5=8BL' ) ;  
 	 	 	 	 }  
 	 	 	 	 i f ( j s o n . r e s u l t = = ' r e m o v e ' ) {  
 	 	 	 	 	 $ ( ' # c o u n t _ ' + i d ) . a t t r ( ' c l a s s ' , ' ' ) ;  
 	 	 	 	 	 $ ( ' # c o u n t _ ' + i d ) . a t t r ( ' v a l u e ' , ' 1 ' ) ;  
 	 	 	 	 	 $ ( ' # a _ ' + i d ) . h t m l ( '   :>@78=C' ) ;  
 	 	 	 	 	 $ ( ' # i n p _ ' + i d ) . v a l ( '   :>@78=C' ) ;  
 	 	 	 	 }  
 	 	 	 } ) ;  
 	 	 } e l s e {  
 	 	 	 d a t a . c o u n t = 1 ;  
 	 	 	 $ ( ' # c o u n t _ ' + i d ) . v a l ( 1 )  
 	 	 }  
 	 } e l s e {  
 	 	 d a t a . c o u n t = 1 ;  
 	 	 $ ( ' # c o u n t _ ' + i d ) . v a l ( 1 )  
 	 }  
 }  
 f u n c t i o n   b a s k e t O r d e r s ( i d , f l a g ) {  
 	 v a r   b a s k e t _ b l o c k = $ ( ' # b a s k e t _ b l o c k ' ) ;  
 	 v a r   d a t a   =   {  
 	 	 w h a t :   ' c h a n g e ' ,  
 	 	 i d :   i d ,  
 	 	 c o u n t :   $ ( ' # c o u n t _ ' + i d ) . v a l ( ) ,  
 	 	 f l a g :   f l a g  
 	 } ;  
 	 i f ( d a t a . c o u n t ! = p a r s e I n t ( M a t h . a b s ( d a t a . c o u n t ) ) ) {  
 	 	 d a t a . c o u n t = 1 ;  
 	 	 $ ( ' # c o u n t _ ' + i d ) . v a l ( 1 )  
 	 } e l s e {  
 	 	 i f ( d a t a . c o u n t = = 0 ) {  
 	 	 	 d a t a . c o u n t = 1 ;  
 	 	 	 $ ( ' # c o u n t _ ' + i d ) . v a l ( 1 )  
 	 	 }  
 	 }  
 	 i f ( f l a g = = 3 ) {  
 	 	 $ ( ' . r s ' ) . r e m o v e A t t r ( ' c h e c k e d ' ) ;  
 	 	 $ ( ' # r s _ ' + i d ) . a t t r ( ' c h e c k e d ' , ' 1 ' ) ;  
 	 	 $ ( ' . r s _ s u m ' ) . h t m l ( ' 0 ' ) ;  
 	 }  
 / / 	 a l e r t ( ' w h a t ' + ' = ' + d a t a . w h a t + ' | ' + ' i d ' + ' = ' + d a t a . i d + ' | ' + ' c o u n t ' + ' = ' + d a t a . c o u n t + ' | ' + ' f l a g ' + ' = ' + d a t a . f l a g ) ;  
 	 $ . g e t J S O N ( ' / b a s k e t / b a s k e t . h t m l ' ,   d a t a ,   f u n c t i o n ( j s o n ) {  
 / / 	 	 a l e r t ( ' j s o n . b a s k e t _ c o u n t ' + ' = ' + j s o n . b a s k e t _ c o u n t + ' | ' + ' j s o n . b a s k e t _ p r i c e ' + ' = ' + j s o n . b a s k e t _ p r i c e + ' | ' + ' j s o n . s u m ' + ' = ' + j s o n . s u m + ' | ' + ' j s o n . r e s u l t ' + ' = ' + j s o n . r e s u l t + ' | ' + ' j s o n . i e a l e r t ' + ' = ' + j s o n . i e a l e r t ) ;  
 	 	 i f ( j s o n . b a s k e t _ c o u n t = = 0 ) {  
 	 	 	 b a s k e t _ b l o c k . h i d e ( ) ;  
 	 	 	 $ ( ' # b a s k e t _ c o u n t ' ) . h t m l ( ' 0 ' ) ;  
 	 	 	 $ ( ' # b a s k e t _ p a y ' ) . h t m l ( ' 0 ' ) ;  
 	 	 }   e l s e   {  
 	 	 	 b a s k e t _ b l o c k . s h o w ( )  
 	 	 	 $ ( ' # b a s k e t _ c o u n t ' ) . h t m l ( j s o n . b a s k e t _ c o u n t ) ;  
 	 	 	 $ ( ' # b a s k e t _ p a y ' ) . h t m l ( j s o n . b a s k e t _ p r i c e ) ;  
 	 	 }  
 / / 	 	 	 	 $ ( ' # b a s k e t _ c o u n t ' ) . h t m l ( j s o n . b a s k e t _ c o u n t ) ;  
 / / 	 	 	 	 $ ( ' # b a s k e t _ p a y ' ) . h t m l ( j s o n . b a s k e t _ p r i c e ) ;  
 	 	 i f ( j s o n . r e s u l t = = ' c h a n g e ' ) {  
 	 	 	 $ ( ' # s u m _ ' + i d ) . h t m l ( j s o n . s u m ) ;  
 	 	 	 $ ( ' # g s u m ' ) . h t m l ( j s o n . b a s k e t _ p r i c e ) ;  
 	 	 }  
 / / 	 	 	 i f ( j s o n . r e s u l t = = ' a d d ' ) {  
 / / 	 	 	 	 $ ( ' # c o u n t _ ' + i d ) . a t t r ( ' c l a s s ' , ' b a s k e t ' ) ;  
 / / 	 	 	 }  
 	 	 i f ( j s o n . r e s u l t = = ' r e m o v e ' ) {  
 	 	 	 $ ( ' # c o u n t _ ' + i d ) . a t t r ( ' c l a s s ' , ' ' ) ;  
 	 	 	 $ ( ' # c o u n t _ ' + i d ) . a t t r ( ' v a l u e ' , ' 1 ' ) ;  
 	 	 	 w i n d o w . l o c a t i o n . h r e f   =   ' . / ' ;  
 	 	 }  
 	 } ) ;  
 }  
  
 f u n c t i o n   d e l O r d e r s ( i d ) {  
 	 v a r   b a s k e t _ b l o c k = $ ( ' # b a s k e t _ b l o c k ' ) ;  
 	 v a r   d a t a   =   {  
 	 	 w h a t :   ' c l e a r ' ,  
 	 	 i d :   i d  
 	 } ;  
 	 $ . p o s t ( ' / b a s k e t / b a s k e t . h t m l ' ,   d a t a ,   f u n c t i o n ( d a t a )   {  
 	 	 w i n d o w . l o c a t i o n . h r e f   =   ' . / ' ;  
 	 } ) ;  
 }  
  
 f u n c t i o n   b a s k e t C l e a r ( ) {  
 	 v a r   b a s k e t _ b l o c k = $ ( ' # b a s k e t _ b l o c k ' ) ;  
 	 v a r   d a t a   =   {  
 	 	 w h a t :   ' c l e a r '  
 	 } ;  
 	 $ . p o s t ( ' / b a s k e t / b a s k e t . h t m l ' ,   d a t a ,   f u n c t i o n ( d a t a )   {  
 	 	 b a s k e t _ b l o c k . h i d e ( ) ;  
 	 	 w i n d o w . l o c a t i o n . h r e f   =   ' . / ' ;  
 	 } ) ;  
 }  
  
 
