ÿþ 
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
 *   I F r a m e   S S I   s c r i p t   I I -   ©   D y n a m i c   D r i v e   D H T M L   c o d e   l i b r a r y   ( h t t p : / / w w w . d y n a m i c d r i v e . c o m )  
 *   V i s i t   D y n a m i c D r i v e . c o m   f o r   h u n d r e d s   o f   o r i g i n a l   D H T M L   s c r i p t s  
 *   T h i s   n o t i c e   m u s t   s t a y   i n t a c t   f o r   l e g a l   u s e  
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
 / / 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 = [ " m y f r a m e " ]  
  
 / / 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 "  
  
 v a r   g e t F F V e r s i o n = n a v i g a t o r . u s e r A g e n t . s u b s t r i n g ( n a v i g a t o r . u s e r A g e n t . i n d e x O f ( " F i r e f o x " ) ) . s p l i t ( " / " ) [ 1 ]  
 v a r   F F e x t r a H e i g h t = p a r s e F l o a t ( g e t F F V e r s i o n ) > = 0 . 1 ?   1 6   :   0   / / e x t r a   h e i g h t   i n   p x   t o   a d d   t o   i f r a m e   i n   F i r e F o x   1 . 0 +   b r o w s e r s  
  
 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 + F F e x t r a H e i g h t ;    
 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 ;  
 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  
  
 
