Possible Duplicate:
How to make in Javascript full screen windows (stretching all over the screen)
Currently I tried to do something like, when you click a fullscreen button current window will become full screen. I tried to use the following script, but it doesn't work. Any ideas on how to make this work?
<script type="text/javascript">
window.onload = maxWindow;
function maxWindow() {
window.moveTo(0, 0);
if (document.all) {
top.window.resizeTo(screen.availWidth, screen.availHeight);
}
else if (document.layers || document.getElementById) {
if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>