ÿþ/ / I n p u t   t h e   I D s   o f   t h e   I F R A M E S   y o u   w i s h   t o   d y n a m i c a l l y   r e s i z e   t o   m a t c h   i t s   c o n t e n t   h e i g h t :  
 / / S e p a r a t e   e a c h   I D   w i t h   a   c o m m a .   E x a m p l e s :   [ " m y f r a m e 1 " ,   " m y f r a m e 2 " ]   o r   [ " m y f r a m e " ]   o r   [ ]   f o r   n o n e :  
 v a r   i f r a m e i d s = [ " p o l l " ,   " p i c _ l i s t " ]  
  
 / / S h o u l d   s c r i p t   h i d e   i f r a m e   f r o m   b r o w s e r s   t h a t   d o n ' t   s u p p o r t   t h i s   s c r i p t   ( n o n   I E 5 + / N S 6 +   b r o w s e r s .   R e c o m m e n d e d ) :  
 v a r   i f r a m e h i d e = " y e s "  
  
  
  
  
  
 f u n c t i o n   a d d b o o k m a r k ( ) {  
 i f   ( d o c u m e n t . a l l )  
 w i n d o w . e x t e r n a l . A d d F a v o r i t e ( b o o k m a r k u r l , b o o k m a r k t i t l e )  
 }  
  
  
  
  
  
 f u n c t i o n   r e s i z e C a l l e r ( )   {  
 v a r   d y n i f r a m e = n e w   A r r a y ( )  
 f o r   ( i = 0 ;   i < i f r a m e i d s . l e n g t h ;   i + + ) {  
 i f   ( d o c u m e n t . g e t E l e m e n t B y I d )  
 r e s i z e I f r a m e ( i f r a m e i d s [ i ] )  
 / / r e v e a l   i f r a m e   f o r   l o w e r   e n d   b r o w s e r s ?   ( s e e   v a r   a b o v e ) :  
 i f   ( ( d o c u m e n t . a l l   | |   d o c u m e n t . g e t E l e m e n t B y I d )   & &   i f r a m e h i d e = = " n o " ) {  
 v a r   t e m p o b j = d o c u m e n t . a l l ?   d o c u m e n t . a l l [ i f r a m e i d s [ i ] ]   :   d o c u m e n t . g e t E l e m e n t B y I d ( i f r a m e i d s [ i ] )  
 t e m p o b j . s t y l e . d i s p l a y = " b l o c k "  
 }  
 }  
 }  
  
 f u n c t i o n   r e s i z e I f r a m e ( f r a m e i d ) {  
 v a r   c u r r e n t f r = d o c u m e n t . g e t E l e m e n t B y I d ( f r a m e i d )  
 i f   ( c u r r e n t f r   & &   ! w i n d o w . o p e r a ) {  
 c u r r e n t f r . s t y l e . d i s p l a y = " b l o c k "  
 i f   ( c u r r e n t f r . c o n t e n t D o c u m e n t   & &   c u r r e n t f r . c o n t e n t D o c u m e n t . b o d y . o f f s e t H e i g h t )   / / n s 6   s y n t a x  
 c u r r e n t f r . h e i g h t   =   c u r r e n t f r . c o n t e n t D o c u m e n t . b o d y . o f f s e t H e i g h t + 1 2 ;    
 e l s e   i f   ( c u r r e n t f r . D o c u m e n t   & &   c u r r e n t f r . D o c u m e n t . b o d y . s c r o l l H e i g h t )   / / i e 5 +   s y n t a x  
 c u r r e n t f r . h e i g h t   =   c u r r e n t f r . D o c u m e n t . b o d y . s c r o l l H e i g h t + 1 2 ;  
 i f   ( c u r r e n t f r . a d d E v e n t L i s t e n e r )  
 c u r r e n t f r . a d d E v e n t L i s t e n e r ( " l o a d " ,   r e a d j u s t I f r a m e ,   f a l s e )  
 e l s e   i f   ( c u r r e n t f r . a t t a c h E v e n t ) {  
 c u r r e n t f r . d e t a c h E v e n t ( " o n l o a d " ,   r e a d j u s t I f r a m e )   / /   B u g   f i x   l i n e  
 c u r r e n t f r . a t t a c h E v e n t ( " o n l o a d " ,   r e a d j u s t I f r a m e )  
 }  
 }  
 }  
  
 f u n c t i o n   r e a d j u s t I f r a m e ( l o a d e v t )   {  
 v a r   c r o s s e v t = ( w i n d o w . e v e n t ) ?   e v e n t   :   l o a d e v t  
 v a r   i f r a m e r o o t = ( c r o s s e v t . c u r r e n t T a r g e t ) ?   c r o s s e v t . c u r r e n t T a r g e t   :   c r o s s e v t . s r c E l e m e n t  
 i f   ( i f r a m e r o o t )  
 r e s i z e I f r a m e ( i f r a m e r o o t . i d ) ;  
 }  
  
 f u n c t i o n   l o a d i n t o I f r a m e ( i f r a m e i d ,   u r l ) {  
 i f   ( d o c u m e n t . g e t E l e m e n t B y I d )  
 d o c u m e n t . g e t E l e m e n t B y I d ( i f r a m e i d ) . s r c = u r l  
 }  
  
 i f   ( w i n d o w . a d d E v e n t L i s t e n e r )  
 w i n d o w . a d d E v e n t L i s t e n e r ( " l o a d " ,   r e s i z e C a l l e r ,   f a l s e )  
 e l s e   i f   ( w i n d o w . a t t a c h E v e n t )  
 w i n d o w . a t t a c h E v e n t ( " o n l o a d " ,   r e s i z e C a l l e r )  
 e l s e  
 w i n d o w . o n l o a d = r e s i z e C a l l e r  
  
 f u n c t i o n   o p e n l i n k ( u r l )   {  
 	 w i n d o w . l o c a t i o n . h r e f = u r l ;  
 }  
  
 f u n c t i o n   O p e n W i n ( u r l ,   w ,   h )   {  
 	 p r o p s = w i n d o w . o p e n ( u r l ,   ' p o p p a g e ' ,   ' t o o l b a r s = 0 ,   s c r o l l b a r s = 1 ,   l o c a t i o n = 0 ,   s t a t u s b a r s = 0 ,   m e n u b a r s = 0 ,   r e s i z a b l e = 0 ,   w i d t h = ' +   w   + ' ,   h e i g h t = ' +   h   + ' ,   l e f t   =   1 5 0 ,   t o p   =   5 0 ' ) ;  
 }  
  
 / *   A j a x   c o d e   * /  
 v a r   h t t p   =   c r e a t e R e q u e s t O b j e c t ( ) ;  
 v a r   r e q u e s t _ ;  
 v a r   b r o w s e r   =   n a v i g a t o r . a p p N a m e ;  
  
 / * f u n c t i o n   c r e a t e R e q u e s t O b j e c t ( ) {  
 i f ( b r o w s e r   = =   " M i c r o s o f t   I n t e r n e t   E x p l o r e r " ) {  
 	 r e q u e s t _   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;  
 }   e l s e   {  
 	 r e q u e s t _   =   n e w   X M L H t t p R e q u e s t ( ) ;  
 }  
 	 r e t u r n   r e q u e s t _ ;  
 } * /  
  
 / / F r o m :   h t t p : / / w w w . w e b p a s t i e s . c o m / x m l H t t p R e q u e s t  
 f u n c t i o n   c r e a t e R e q u e s t O b j e c t ( ) {  
 	 v a r   x m l h t t p ;  
  
 / * @ c c _ o n  
 	 @ i f   ( @ _ j s c r i p t _ v e r s i o n   > =   5 )  
 	 t r y   {  
 	 	 x m l h t t p   =   n e w   A c t i v e X O b j e c t ( " M s x m l 2 . X M L H T T P " ) ;  
 	 }   c a t c h   ( e )   {  
 	 	 t r y   {  
   	 	 	 x m l h t t p   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;  
 	 	 }   c a t c h   ( E )   {  
 	 	 	 x m l h t t p   =   f a l s e ;  
 	 	 }  
 	 }  
 @ e l s e  
 	 x m l h t t p   =   f a l s e ;  
 @ e n d   @ * /  
  
   	 i f   ( ! x m l h t t p   & &   t y p e o f   X M L H t t p R e q u e s t   ! =   ' u n d e f i n e d ' )   {  
 	 	 t r y   {  
       	 	 	 x m l h t t p   =   n e w   X M L H t t p R e q u e s t ( ) ;  
 	 	 }   c a t c h ( e )   {  
 	 	 	 x m l h t t p   =   f a l s e ;  
 	 	 }  
  
 	 }  
 	 r e t u r n   x m l h t t p ;  
 }  
  
 f u n c t i o n   G e t _ D a t a ( s i d ,   m i d ) {  
 	 h t t p . o p e n ( ' g e t ' ,   ' i n d e x . p h p ? s h o w = s o u n d s & o p = l o a d & i d = ' +   s i d   + ' & l i n k = ' +   m i d ) ;  
 	 h t t p . o n r e a d y s t a t e c h a n g e   =   h a n d l e I n f o ;  
 	 h t t p . s e n d ( n u l l ) ;  
 }  
  
 f u n c t i o n   S e n d _ V o t e ( m i d ,   s c o r e ) {  
 	 h t t p . o p e n ( ' g e t ' ,   ' i n d e x . p h p ? s h o w = s o u n d s & o p = s e n d _ v o t e & i d = ' +   m i d   + ' & s c o r e = ' +   s c o r e ) ;  
 	 h t t p . o n r e a d y s t a t e c h a n g e   =   v o t e _ h a n d l e ;  
 	 h t t p . s e n d ( n u l l ) ;  
 }  
 f u n c t i o n   v o t e _ h a n d l e ( ) {  
 	 i f ( h t t p . r e a d y S t a t e   = =   1 ) {  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' v o t e ' ) . i n n e r H T M L   =   ' S e n d i n g   d a t a   . . . ' ;  
 	 }  
 	 i f ( h t t p . r e a d y S t a t e   = =   4 ) {  
 	 	 v a r   r e s p o n s e   =   h t t p . r e s p o n s e T e x t ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' v o t e ' ) . i n n e r H T M L   =   r e s p o n s e ;  
 	 }  
 }  
  
 f u n c t i o n   h a n d l e I n f o   ( ) {  
 	 i f ( h t t p . r e a d y S t a t e   = =   2 ) {  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' s o u n d _ c o n ' ) . i n n e r H T M L   = ' ,'1J  'D*-EJD. . . ' ;  
 	 }  
 	 i f ( h t t p . r e a d y S t a t e   = =   4 ) {  
 	 	 v a r   r e s p o n s e   =   h t t p . r e s p o n s e T e x t ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' s o u n d _ c o n ' ) . i n n e r H T M L   =   r e s p o n s e ;  
 	 }  
 }  
  
 f u n c t i o n   s e n d ( u r l ,   w ,   h )   {  
 	 	 p r o p s = w i n d o w . o p e n ( u r l ,   ' p o p p a g e ' ,   ' t o o l b a r s = 0 ,   s c r o l l b a r s = 0 ,   l o c a t i o n = 0 ,   s t a t u s b a r s = 0 ,   m e n u b a r s = 0 ,   r e s i z a b l e = 0 ,   w i d t h = 4 2 0 ,   h e i g h t = 3 5 0 ,   l e f t   =   1 5 0 ,   t o p   =   5 0 ' ) ;  
 } 
