Fullscreen mode is optional so there is no forcing involved. Anyway, I figured out how to do it myself.
var screensettings = "small"
function screenchange()
{
if (screensettings == "small")
{
if (document.layers)
{
if (top.window.innerWidth == screen.width)
{
alert("Window cannot be maximized when entering fullscreen mode.");
} else {
screensettings = "big";
fullscreen()
}
} else {
if (top.document.body.offsetWidth == screen.width)
{
alert("Window cannot be maximized when entering fullscreen mode.");
} else {
screensettings = "big";
fullscreen()
}
}
} else {
screensettings = "small";
restore()
}
}
function fullscreen()
{
if (document.layers)
{
top.window.resizeTo(screen.width+20,screen.height+300);
top.window.moveTo(-10,-100);
} else {
top.window.resizeTo(screen.width+20,screen.height+300);
top.window.moveTo(-10,-100);
}
}
function restore()
{
if (document.layers)
{
top.window.resizeTo(200,200);
top.window.moveTo(0,0);
} else {
top.window.resizeTo(200,200);
top.window.moveTo(0,0);
}
}