> var xres = screen.width; > var yres = screen.height; Keep in mind that these are v4+ browser properties, so you should have define fall-back default value if you need to support NS3...