2 function domSniffer() {
4 var s
= navigator
.userAgent
;
5 if (s
.indexOf("Mac") >=0) this.mac
= t
;
6 if (s
.indexOf("Opera") >=0) this.opera
= t
;
8 if (d
.layers
) this.n4
= t
;
9 if (d
.childNodes
) this.dom
= t
;
10 if (d
.all
&& d
.plugins
) this.ie
= t
;
12 function getContentH(lyr
) {
13 return (is
.n4
) ? lyr
.document
.height
: (is
.ie
) ? (is
.mac
? lyr
.offsetHeight
: lyr
.scrollHeight
) : (is
.opera
) ? lyr
.style
.pixelHeight
: (is
.dom
) ? lyr
.offsetHeight
: 0;
18 function setSize(obj
, w
, h
) {
21 if (h
) obj
.height
= h
;
22 } else if (is
.opera
) {
23 // opera 5 needs pixelWidth/Height
24 if (w
) obj
.style
.pixelWidth
= w
;
25 if (h
) obj
.style
.pixelHeight
= h
;
27 if (w
) obj
.style
.width
= px(w
);
28 if (h
) obj
.style
.height
= px(h
);
31 function getElement(id
, lyr
) {
32 var d
= (document
.layers
&& lyr
) ? lyr
.document
: document
;
33 var obj
= (document
.layers
) ? eval("d."+id
) : (d
.all
) ? d
.all
[id
] : (d
.getElementById
) ? d
.getElementById(id
) : null;
36 is
= new domSniffer();
37 function set_iframe_height(id
) {
38 var iframe
= getElement(id
);
40 var obj
= iframe
.document
|| iframe
.contentDocument
|| null; // IE || FireFox
45 var h
= getContentH(obj
);
47 setSize(iframe
, 0, h
);