function resize() { dx = Math.min( 440, screen.availWidth ); dy = Math.min( 540, screen.availHeight ); x = Math.min( ( screen.availWidth - dx ) / 2, 20 ); y = Math.min( ( screen.availHeight - dy ) / 2, 20 ); window.moveTo( x, y ); window.resizeTo( dx, dy ); } resize(); Video