(When you've got a framed page, window refer to the current frame. If you want to refer to the main window you've got to use parent.As well if you want to interact with other frames you have to pass by the main window. It's like a path to access frames within you pages).