01.
<script type=
"text/javascript"
>
02.
<!--
03.
04.
var
viewportwidth;
05.
var
viewportheight;
06.
07.
08.
09.
if
(
typeof
window.innerWidth !=
'undefined'
)
10.
{
11.
viewportwidth = window.innerWidth,
12.
viewportheight = window.innerHeight
13.
}
14.
15.
16.
17.
else
if
(
typeof
document.documentElement !=
'undefined'
18.
&&
typeof
document.documentElement.clientWidth !=
19.
'undefined'
&& document.documentElement.clientWidth != 0)
20.
{
21.
viewportwidth = document.documentElement.clientWidth,
22.
viewportheight = document.documentElement.clientHeight
23.
}
24.
25.
26.
27.
else
28.
{
29.
viewportwidth = document.getElementsByTagName(
'body'
)[0].clientWidth,
30.
viewportheight = document.getElementsByTagName(
'body'
)[0].clientHeight
31.
}
32.
33.
34.
</script>