Set the initial resize vars, w and h to the size you want of the window instead of screen.height or screen.width.
I beleive this should do the trick.
You can remove the
Code:
newWidth=screen.height;
newHeight=screen.height;
if(newHeight>=screen.height) {
newHeight=screen.height-30;
}
if(newWidth>=screen.width) {
newWidth=screen.width;
}
Segments of code in the forward and backward function calls as well as they won't be needed anymore.