2 function scorm_get_element_style(obj
, prop
, cssProp
) {
5 if (obj
.currentStyle
) {
6 ret
= obj
.currentStyle
[prop
];
7 } else if (document
.defaultView
&& document
.defaultView
.getComputedStyle
) {
8 var compStyle
= document
.defaultView
.getComputedStyle(obj
, null);
9 ret
= compStyle
.getPropertyValue(cssProp
);
12 if (ret
== 'auto') ret
= '0';
16 function scorm_resize () {
17 var winwidth
= 0, winheight
= 0;
18 if( typeof( window
.innerWidth
) == 'number' ) {
20 winwidth
= window
.innerWidth
;
21 winheight
= window
.innerHeight
;
22 } else if( document
.documentElement
&& ( document
.documentElement
.clientWidth
|| document
.documentElement
.clientHeight
) ) {
23 //IE 6+ in 'standards compliant mode'
24 winwidth
= document
.documentElement
.clientWidth
;
25 winheight
= document
.documentElement
.clientHeight
;
26 } else if( document
.body
&& ( document
.body
.clientWidth
|| document
.body
.clientHeight
) ) {
28 winwidth
= document
.body
.clientWidth
;
29 winheight
= document
.body
.clientHeight
;
32 var header
= document
.getElementById('header');
33 var content
= document
.getElementById('content');
36 headerheight
= content
.offsetTop
;
39 var footer
= document
.getElementById('footer');
40 var imsnavbar
= document
.getElementById('tochead');
41 var scormtop
= document
.getElementById('scormtop');
44 var scormtopheight
= 0;
46 footerheight
= footer
.offsetHeight
+ parseInt(scorm_get_element_style(footer
, 'marginTop', 'margin-top')) + parseInt(scorm_get_element_style(footer
, 'marginBottom', 'margin-bottom'));
49 imsnavheight
= imsnavbar
.offsetHeight
;
52 scormtopheight
= scormtop
.offsetHeight
;
55 var topmargin
= parseInt(scorm_get_element_style(document
.getElementsByTagName('body')[0], 'marginTop', 'margin-top'));
56 var bottommargin
= parseInt(scorm_get_element_style(document
.getElementsByTagName('body')[0], 'marginBottom', 'margin-bottom'));
58 var totalheight
= headerheight
+
62 bottommargin
+10; // +10 to save a minor vertical scroll always present!
64 var totalheighttoc
= totalheight
+imsnavheight
;
65 var toctree
= document
.getElementById('toctree');
67 var toctreeHeight
= toctree
.offsetHeight
;
68 document
.getElementById('toctree').style
.height
= (winheight
- totalheighttoc
) + 'px';
69 var scoframe2
= document
.getElementById('scoframe1');
70 document
.getElementById('scormobject').style
.height
= (winheight
- totalheight
) + 'px';
72 var scoframe2
= document
.getElementById('scoframe1');
73 document
.getElementById('scormobject').style
.height
= (winheight
- totalheight
) + 'px';
76 // resize the content container too to move the footer below the SCORM content
77 var contenti3
= document
.getElementById('content-i3');
79 contenti3
.style
.height
= (winheight
- totalheight
+ 30) + 'px';
81 document
.getElementById('content').style
.height
= (winheight
- totalheight
+ 30) + 'px';
83 // resize the content container too to move the footer below the SCORM content
84 var contenti3
= document
.getElementById('content-i3');
86 contenti3
.style
.height
= (winheight
- totalheight
+ 30) + 'px';
88 document
.getElementById('content').style
.height
= (winheight
- totalheight
+ 30) + 'px';